Skip to content

Commit 22d2eaa

Browse files
committed
docs: add docstrings in Portfolio
1 parent fa8bb21 commit 22d2eaa

File tree

6 files changed

+1288
-26
lines changed

6 files changed

+1288
-26
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/docs/_build/
2+
/docs/source/
3+
/docs/stubs/

docs/conf.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7+
import os
8+
import sys
9+
from os import path
10+
11+
import matplotlib
12+
13+
import okama # isort:skip
14+
715
# -- Path setup --------------------------------------------------------------
816

917
# If extensions (or modules to document with autodoc) are in another directory,
1018
# add these directories to sys.path here. If the directory is relative to the
1119
# documentation root, use os.path.abspath to make it absolute, like shown here.
1220
#
13-
import os
14-
import sys
15-
from os import path
16-
17-
import okama # isort:skip
1821

1922
root = path.realpath(path.join(path.dirname(__file__), "..", ".."))
2023
sys.path.insert(1, root)
24+
sys.path.append(os.path.abspath('matplotlib_ext'))
2125
# sys.path.insert(0, os.path.abspath("."))
2226

2327

@@ -54,6 +58,7 @@
5458
# ones.
5559
extensions = [
5660
# "sphinx.ext.napoleon",
61+
'matplotlib.sphinxext.plot_directive',
5762
"numpydoc", # handle NumPy documentation formatted docstrings instead of napoleon
5863
"sphinx.ext.autodoc",
5964
"sphinx.ext.autosummary",
@@ -103,7 +108,7 @@
103108
# so a file named "default.css" will overwrite the builtin "default.css".
104109
html_static_path = ["_static"]
105110

106-
# -- Options for typehints ------------------------------------------------
111+
# -- Options for autodoc ------------------------------------------------
107112

108113
# This value controls how to represents typehints.
109114
autodoc_typehints = "none"
@@ -114,12 +119,24 @@
114119
# -- Options for numpydoc ------------------------------------------------
115120
numpydoc_attributes_as_param_list = False
116121
numpydoc_show_class_members = False
122+
numpydoc_use_plots = True
123+
numpydoc_class_members_toctree = True
117124

118125
# -- Options for nbsphinx ------------------------------------------------
119126

120127
# nbsphinx do not use requirejs (breaks bootstrap)
121128
nbsphinx_requirejs_path = ""
122129

130+
# matplotlib plot directive settings
131+
plot_html_show_formats = False
132+
plot_include_source = True
133+
plot_html_show_source_link = False
134+
plot_pre_code = """
135+
import numpy as np
136+
from matplotlib import pyplot as plt
137+
import okama as ok
138+
"""
139+
123140
# # Napoleon settings
124141
# napoleon_google_docstring = False
125142
# napoleon_numpy_docstring = True

docs/images/ef.png

90.5 KB
Loading

0 commit comments

Comments
 (0)