Skip to content

Commit 22f5d2b

Browse files
woopfeast-ci-bot
authored andcommitted
Python SDK cleanup (#348)
* Refactor and add comments to loaders module * Add more descriptive comments to Python SDK * Add more descriptive comments to Python SDK * Yet more comments added and refactored * Add Sphinx docs for Python SDK API
1 parent a53e06b commit 22f5d2b

30 files changed

+1285
-11223
lines changed

sdk/python/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434

3535

3636
def common_options(func):
37+
"""
38+
Options that are available for most CLI commands
39+
"""
3740
for option in reversed(_common_options):
3841
func = option(func)
3942
return func
@@ -62,10 +65,10 @@ def version(client_only: bool, **kwargs):
6265
if not client_only:
6366
feast_client = Client(
6467
core_url=feast_config.get_config_property_or_fail(
65-
"core_url", cli_config=kwargs
68+
"core_url", force_config=kwargs
6669
),
6770
serving_url=feast_config.get_config_property_or_fail(
68-
"serving_url", cli_config=kwargs
71+
"serving_url", force_config=kwargs
6972
),
7073
)
7174
feast_versions_dict.update(feast_client.version())
@@ -92,7 +95,7 @@ def config_list():
9295
"""
9396

9497
try:
95-
feast_config_string = toml.dumps(feast_config.get_or_create_config())
98+
feast_config_string = toml.dumps(feast_config._get_or_create_config())
9699
if not feast_config_string.strip():
97100
print("Configuration has not been set")
98101
else:

sdk/python/docs/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = Feast
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile source
16+
17+
source:
18+
sphinx-apidoc -f -o source ../feast
19+
20+
# Catch-all target: route all unknown targets to Sphinx using the new
21+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
22+
%: Makefile source
23+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

sdk/python/docs/source/conf.py

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Feast documentation build configuration file, created by
4+
# sphinx-quickstart on Sat Nov 30 15:06:53 2019.
5+
#
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
8+
#
9+
# Note that not all possible configuration values are present in this
10+
# autogenerated file.
11+
#
12+
# All configuration values have a default; values that are commented out
13+
# serve to show the default.
14+
15+
# If extensions (or modules to document with autodoc) are in another directory,
16+
# add these directories to sys.path here. If the directory is relative to the
17+
# documentation root, use os.path.abspath to make it absolute, like shown here.
18+
#
19+
import os
20+
import sys
21+
import sphinx_rtd_theme
22+
23+
24+
sys.path.insert(0, os.path.abspath("../feast"))
25+
26+
27+
# -- General configuration ------------------------------------------------
28+
29+
# If your documentation needs a minimal Sphinx version, state it here.
30+
#
31+
# needs_sphinx = '1.0'
32+
33+
# Add any Sphinx extension module names here, as strings. They can be
34+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35+
# ones.
36+
extensions = [
37+
"sphinx.ext.doctest",
38+
"sphinx.ext.intersphinx",
39+
"sphinx.ext.todo",
40+
"sphinx.ext.coverage",
41+
"sphinx.ext.mathjax",
42+
"sphinx.ext.ifconfig",
43+
"sphinx.ext.viewcode",
44+
"sphinx.ext.githubpages",
45+
"sphinx.ext.napoleon",
46+
"sphinx.ext.autodoc",
47+
"sphinx_rtd_theme",
48+
]
49+
50+
# Add any paths that contain templates here, relative to this directory.
51+
templates_path = ["_templates"]
52+
53+
# The suffix(es) of source filenames.
54+
# You can specify multiple suffix as a list of string:
55+
#
56+
# source_suffix = ['.rst', '.md']
57+
source_suffix = ".rst"
58+
59+
# The master toctree document.
60+
master_doc = "index"
61+
62+
# General information about the project.
63+
project = u"Feast"
64+
copyright = u"2019, Feast Authors"
65+
author = u"Feast Authors"
66+
67+
# The version info for the project you're documenting, acts as replacement for
68+
# |version| and |release|, also used in various other places throughout the
69+
# built documents.
70+
#
71+
# The short X.Y version.
72+
version = u"0.3.2"
73+
# The full version, including alpha/beta/rc tags.
74+
release = u"0.3.2"
75+
76+
# The language for content autogenerated by Sphinx. Refer to documentation
77+
# for a list of supported languages.
78+
#
79+
# This is also used if you do content translation via gettext catalogs.
80+
# Usually you set "language" from the command line for these cases.
81+
language = None
82+
83+
# List of patterns, relative to source directory, that match files and
84+
# directories to ignore when looking for source files.
85+
# This patterns also effect to html_static_path and html_extra_path
86+
exclude_patterns = []
87+
88+
# The name of the Pygments (syntax highlighting) style to use.
89+
pygments_style = "sphinx"
90+
91+
# If true, `todo` and `todoList` produce output, else they produce nothing.
92+
todo_include_todos = True
93+
94+
95+
# -- Options for HTML output ----------------------------------------------
96+
97+
# The theme to use for HTML and HTML Help pages. See the documentation for
98+
# a list of builtin themes.
99+
#
100+
html_theme = "sphinx_rtd_theme"
101+
102+
# Theme options are theme-specific and customize the look and feel of a theme
103+
# further. For a list of options available for each theme, see the
104+
# documentation.
105+
#
106+
html_theme_options = {"font_size": "15px"}
107+
108+
# Add any paths that contain custom static files (such as style sheets) here,
109+
# relative to this directory. They are copied after the builtin static files,
110+
# so a file named "default.css" will overwrite the builtin "default.css".
111+
html_static_path = ["_static"]
112+
113+
114+
# -- Options for HTMLHelp output ------------------------------------------
115+
116+
# Output file base name for HTML help builder.
117+
htmlhelp_basename = "Feastdoc"
118+
119+
120+
# -- Options for LaTeX output ---------------------------------------------
121+
122+
latex_elements = {
123+
# The paper size ('letterpaper' or 'a4paper').
124+
#
125+
# 'papersize': 'letterpaper',
126+
# The font size ('10pt', '11pt' or '12pt').
127+
#
128+
# 'pointsize': '10pt',
129+
# Additional stuff for the LaTeX preamble.
130+
#
131+
# 'preamble': '',
132+
# Latex figure (float) alignment
133+
#
134+
# 'figure_align': 'htbp',
135+
}
136+
137+
# Grouping the document tree into LaTeX files. List of tuples
138+
# (source start file, target name, title,
139+
# author, documentclass [howto, manual, or own class]).
140+
latex_documents = [
141+
(master_doc, "Feast.tex", u"Feast Documentation", u"Feast Authors", "manual")
142+
]
143+
144+
145+
# -- Options for manual page output ---------------------------------------
146+
147+
# One entry per manual page. List of tuples
148+
# (source start file, name, description, authors, manual section).
149+
man_pages = [(master_doc, "feast", u"Feast Documentation", [author], 1)]
150+
151+
152+
# -- Options for Texinfo output -------------------------------------------
153+
154+
# Grouping the document tree into Texinfo files. List of tuples
155+
# (source start file, target name, title, author,
156+
# dir menu entry, description, category)
157+
texinfo_documents = [
158+
(
159+
master_doc,
160+
"Feast",
161+
u"Feast Documentation",
162+
author,
163+
"Feast",
164+
"One line description of project.",
165+
"Miscellaneous",
166+
)
167+
]
168+
169+
170+
# Example configuration for intersphinx: refer to the Python standard library.
171+
intersphinx_mapping = {"https://docs.python.org/": None}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
feast.core package
2+
==================
3+
4+
Submodules
5+
----------
6+
7+
feast.core.CoreService\_pb2 module
8+
----------------------------------
9+
10+
.. automodule:: feast.core.CoreService_pb2
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
feast.core.CoreService\_pb2\_grpc module
16+
----------------------------------------
17+
18+
.. automodule:: feast.core.CoreService_pb2_grpc
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
feast.core.FeatureSet\_pb2 module
24+
---------------------------------
25+
26+
.. automodule:: feast.core.FeatureSet_pb2
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
feast.core.FeatureSet\_pb2\_grpc module
32+
---------------------------------------
33+
34+
.. automodule:: feast.core.FeatureSet_pb2_grpc
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
feast.core.Source\_pb2 module
40+
-----------------------------
41+
42+
.. automodule:: feast.core.Source_pb2
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
47+
feast.core.Source\_pb2\_grpc module
48+
-----------------------------------
49+
50+
.. automodule:: feast.core.Source_pb2_grpc
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
feast.core.Store\_pb2 module
56+
----------------------------
57+
58+
.. automodule:: feast.core.Store_pb2
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
63+
feast.core.Store\_pb2\_grpc module
64+
----------------------------------
65+
66+
.. automodule:: feast.core.Store_pb2_grpc
67+
:members:
68+
:undoc-members:
69+
:show-inheritance:
70+
71+
72+
Module contents
73+
---------------
74+
75+
.. automodule:: feast.core
76+
:members:
77+
:undoc-members:
78+
:show-inheritance:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
feast.loaders package
2+
=====================
3+
4+
Submodules
5+
----------
6+
7+
feast.loaders.file module
8+
-------------------------
9+
10+
.. automodule:: feast.loaders.file
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
feast.loaders.ingest module
16+
---------------------------
17+
18+
.. automodule:: feast.loaders.ingest
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
feast.loaders.yaml module
24+
-------------------------
25+
26+
.. automodule:: feast.loaders.yaml
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
32+
Module contents
33+
---------------
34+
35+
.. automodule:: feast.loaders
36+
:members:
37+
:undoc-members:
38+
:show-inheritance:

0 commit comments

Comments
 (0)