|
14 | 14 | import time
|
15 | 15 | from pathlib import Path
|
16 | 16 |
|
17 |
| -sys.path.insert(0, os.path.abspath('..')) |
18 |
| -sys.path.insert(0, os.path.abspath('sphinxext')) |
| 17 | +sys.path.insert(0, os.path.abspath("..")) |
| 18 | +sys.path.insert(0, os.path.abspath("sphinxext")) |
19 | 19 |
|
20 | 20 |
|
21 | 21 | # -- Project information -----------------------------------------------------
|
22 | 22 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
23 | 23 |
|
24 |
| -project = 'pynapple' |
| 24 | +project = "pynapple" |
25 | 25 | copyright = f'2021-{time.strftime("%Y")}'
|
26 |
| -author = 'Guillaume Viejo' |
| 26 | +author = "Guillaume Viejo" |
27 | 27 | from importlib.metadata import version
|
| 28 | + |
28 | 29 | release: str = version("pynapple")
|
29 | 30 | # this will grab major.minor.patch (excluding any .devN afterwards, which should only
|
30 | 31 | # show up when building locally during development)
|
31 |
| -version: str = ".".join(release.split('.')[:3]) |
| 32 | +version: str = ".".join(release.split(".")[:3]) |
32 | 33 |
|
33 | 34 |
|
34 | 35 | # -- General configuration ---------------------------------------------------
|
35 | 36 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
36 | 37 |
|
37 | 38 | extensions = [
|
38 |
| - 'sphinx.ext.autodoc', |
39 |
| - 'sphinx.ext.napoleon', |
40 |
| - 'sphinx.ext.autosummary', |
41 |
| - 'sphinx.ext.coverage', |
42 |
| - 'sphinx.ext.viewcode', # Links to source code |
43 |
| - 'sphinx.ext.doctest', |
44 |
| - 'sphinx_copybutton', # Adds copy button to code blocks |
45 |
| - 'sphinx_design', # For layout components |
46 |
| - 'myst_nb', |
47 |
| - 'sphinx_contributors', |
48 |
| - 'matplotlib.sphinxext.plot_directive' |
| 39 | + "sphinx.ext.autodoc", |
| 40 | + "sphinx.ext.napoleon", |
| 41 | + "sphinx.ext.autosummary", |
| 42 | + "sphinx.ext.coverage", |
| 43 | + "sphinx.ext.viewcode", # Links to source code |
| 44 | + "sphinx.ext.doctest", |
| 45 | + "sphinx_copybutton", # Adds copy button to code blocks |
| 46 | + "sphinx_design", # For layout components |
| 47 | + "myst_nb", |
| 48 | + "sphinx_contributors", |
| 49 | + "matplotlib.sphinxext.plot_directive", |
49 | 50 | # 'sphinxcontrib.apidoc'
|
50 |
| - # 'sphinx_gallery.gen_gallery', |
| 51 | + # 'sphinx_gallery.gen_gallery', |
51 | 52 | # 'myst_sphinx_gallery',
|
52 | 53 | ]
|
53 | 54 |
|
54 | 55 |
|
55 |
| -templates_path = ['_templates'] |
| 56 | +templates_path = ["_templates"] |
56 | 57 |
|
57 | 58 |
|
58 | 59 | # The Root document
|
|
62 | 63 | # List of patterns, relative to source directory, that match files and
|
63 | 64 | # directories to ignore when looking for source files.
|
64 | 65 | # This pattern also affects html_static_path and html_extra_path.
|
65 |
| -exclude_patterns = ['_build', 'docstrings', 'nextgen', 'Thumbs.db', '.DS_Store'] |
| 66 | +exclude_patterns = ["_build", "docstrings", "nextgen", "Thumbs.db", ".DS_Store"] |
66 | 67 |
|
67 | 68 |
|
68 | 69 | # Generate the API documentation when building
|
69 | 70 | autosummary_generate = True
|
70 | 71 | numpydoc_show_class_members = True
|
71 | 72 | autodoc_default_options = {
|
72 |
| - 'members': True, |
73 |
| - 'inherited-members': True, |
74 |
| - 'show-inheritance': True, |
75 |
| - } |
| 73 | + "members": True, |
| 74 | + "inherited-members": True, |
| 75 | + "show-inheritance": True, |
| 76 | +} |
76 | 77 |
|
77 | 78 | # apidoc_module_dir = '../pynapple'
|
78 | 79 | # apidoc_output_dir = 'reference'
|
|
84 | 85 | # -- Options for HTML output -------------------------------------------------
|
85 | 86 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
86 | 87 |
|
87 |
| -html_theme = 'pydata_sphinx_theme' |
| 88 | +html_theme = "pydata_sphinx_theme" |
88 | 89 |
|
89 | 90 | html_logo = "_static/Logo/Pynapple_final_logo.png"
|
90 | 91 | html_favicon = "_static/Icon/Pynapple_final_icon.png"
|
|
116 | 117 |
|
117 | 118 | html_sidebars = {
|
118 | 119 | "index": [],
|
119 |
| - "installing":[], |
120 |
| - "about":[], |
121 |
| - "releases":[], |
122 |
| - "external":[], |
123 |
| - "pynajax":[], |
124 |
| - "citing":[], |
| 120 | + "installing": [], |
| 121 | + "about": [], |
| 122 | + "releases": [], |
| 123 | + "external": [], |
| 124 | + "pynajax": [], |
| 125 | + "citing": [], |
125 | 126 | "**": ["search-field.html", "sidebar-nav-bs.html"],
|
126 | 127 | }
|
127 | 128 |
|
128 | 129 | # # Path for static files (custom stylesheets or JavaScript)
|
129 |
| -html_static_path = ['_static'] |
130 |
| -html_css_files = ['custom.css'] |
| 130 | +html_static_path = ["_static"] |
| 131 | +html_css_files = ["custom.css"] |
131 | 132 |
|
132 | 133 | # Copybutton settings (to hide prompt)
|
133 | 134 | copybutton_prompt_text = r">>> |\$ |# "
|
134 | 135 | copybutton_prompt_is_regexp = True
|
135 | 136 |
|
136 | 137 | # Enable markdown and notebook support
|
137 |
| -myst_enable_extensions = ["colon_fence"] # For improved markdown |
| 138 | +myst_enable_extensions = ["colon_fence"] # For improved markdown |
138 | 139 |
|
139 | 140 | # # ----------------------------------------------------------------------------
|
140 | 141 | # # -- Autodoc and Napoleon Options -------------------------------------------------
|
141 | 142 | autodoc_default_options = {
|
142 |
| - 'members': True, |
143 |
| - 'undoc-members': True, |
144 |
| - 'show-inheritance': True, |
| 143 | + "members": True, |
| 144 | + "undoc-members": True, |
| 145 | + "show-inheritance": True, |
145 | 146 | }
|
146 | 147 | napoleon_numpy_docstring = True
|
147 | 148 |
|
148 | 149 |
|
149 |
| - |
150 | 150 | nitpicky = True
|
151 | 151 |
|
152 | 152 | # Set timeout in seconds (e.g., 15 minutes)
|
|
155 | 155 | # Execute notebooks during the build:
|
156 | 156 | nb_execution_mode = "cache"
|
157 | 157 | nb_execution_raise_on_error = True
|
158 |
| - |
159 |
| - |
160 |
| - |
161 |
| - |
162 |
| - |
0 commit comments