-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconf.py
More file actions
73 lines (57 loc) · 2.18 KB
/
Copy pathconf.py
File metadata and controls
73 lines (57 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# pylint: disable=missing-module-docstring
import os
import sys
import time
import torch
import pyprobound
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "PyProBound"
author = "Lucas A.N. Melo and Harmen J. Bussemaker"
year = time.gmtime().tm_year
copyright_year = f"2023-{year}" if year > 2023 else "2023"
project_copyright = f"{copyright_year}, {author}"
release = pyprobound.__version__
version = release
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.mathjax",
"sphinx.ext.autosummary",
"sphinx_rtd_theme",
"sphinx_autodoc_typehints",
"myst_nb",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
autosummary_generate = True
add_module_names = False
autodoc_member_order = "bysource"
napoleon_google_docstring = True
autodoc_default_options = {"member-order": "bysource", "undoc-members": True}
nb_execution_mode = "off"
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_theme_options = {"display_version": True}
html_css_files = ["custom.css"]
def skip_member(app, what, name, obj, skip, options):
del app, what, obj, skip, options
if name not in ("forward", "tensor") and (
(name in dir(torch.nn.Module))
or (name in dir(torch.Tensor))
or (name == "training")
):
return True
def process_docstring(app, what, name, obj, options, lines):
del app, what, name, obj, options
for i in range(len(lines) - 1, -1, -1):
if lines[i].startswith("Alias for field number"):
del lines[i]
def setup(app):
app.connect("autodoc-skip-member", skip_member)
app.connect("autodoc-process-docstring", process_docstring)