Skip to content

Commit

Permalink
try inheritance diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanljones committed Feb 12, 2022
1 parent 6a59762 commit b990e94
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ version: 2

build:
image: latest
apt_packages:
- graphviz

python:
version: 3.7
Expand Down
3 changes: 3 additions & 0 deletions docs/source/_templates/apidoc/module.rst_t
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
{%- for option in automodule_options %}
:{{ option }}:
{%- endfor %}

.. inheritance-diagram:: lattpy.spatial.KDTree
:parts: 1
11 changes: 9 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
'sphinx.ext.extlinks', # define roles for links
'sphinx_toggleprompt', # toggle `>>>`
'sphinx_rtd_theme',
'sphinx.ext.graphviz',
'sphinx.ext.inheritance_diagram'
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -53,6 +55,12 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'tests',
'generated/lattpy.rst', 'generated/modules.rst']
# -- Graphviz options --------------------------------------------------------

graphviz_output_format = 'svg'

inheritance_graph_attrs = dict(rankdir="TB", size='""')


# -- Options for HTML output -------------------------------------------------

Expand Down Expand Up @@ -160,8 +168,7 @@ def run_apidoc(_):
module = os.path.join(proj_dir, "lattpy")
exclude = os.path.join(module, "tests")
template_dir = os.path.join(doc_dir, "source", "_templates", "apidoc")
main(["-fMeT", "-o", output_path, module, exclude, "--templatedir", template_dir,
"--force"])
main(["-fMeT", "-o", output_path, module, exclude, "--templatedir", template_dir])


def setup(app):
Expand Down
1 change: 1 addition & 0 deletions docs/source/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ matplotlib
sphinx>3.0.0 # https://github.com/readthedocs/readthedocs.org/issues/8616
sphinx_toggleprompt
sphinx_rtd_theme
graphviz

0 comments on commit b990e94

Please sign in to comment.