-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathconf.py
More file actions
226 lines (184 loc) · 6.78 KB
/
conf.py
File metadata and controls
226 lines (184 loc) · 6.78 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
"""Provide configuration for Sphinx."""
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import datetime
from functools import partial
from pathlib import Path
from setuptools_scm import get_version
# Check if sphinx-multiversion is installed
use_multiversion = False
try:
import sphinx_multiversion # noqa: F401
use_multiversion = True
except ImportError:
pass
# -- Path setup --------------------------------------------------------------
PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve()
get_scm_version = partial(get_version, root=PROJECT_ROOT_DIR)
# -- Project information -----------------------------------------------------
github_url = "https://github.com"
github_repo_org = "juaml"
github_repo_name = "junifer"
github_repo_slug = f"{github_repo_org}/{github_repo_name}"
github_repo_url = f"{github_url}/{github_repo_slug}"
project = github_repo_name
author = f"{project} Contributors"
copyright = f"{datetime.date.today().year}, {author}"
# The version along with dev tag
release = get_scm_version(
version_scheme="guess-next-dev",
local_scheme="no-local-version",
)
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
# Built-in extensions:
"sphinx.ext.autodoc", # include documentation from docstrings
"sphinx.ext.autosummary", # generate autodoc summaries
"sphinx.ext.doctest", # test snippets in the documentation
"sphinx.ext.extlinks", # markup to shorten external links
"sphinx.ext.intersphinx", # link to other projects` documentation
"sphinx.ext.mathjax", # math support for HTML outputs in Sphinx
# Third-party extensions:
"sphinx_gallery.gen_gallery", # HTML gallery of examples
"numpydoc", # support for NumPy style docstrings
"sphinx_copybutton", # copy button for code blocks
"sphinxcontrib.mermaid", # mermaid support
"sphinxcontrib.towncrier.ext", # towncrier fragment support
"sphinxcontrib.autodoc_pydantic", # autodoc support for pydantic models
"enum_tools.autoenum", # enum support
]
if use_multiversion:
extensions.append("sphinx_multiversion")
# Add any paths that contain templates here, relative to this directory.
templates_path = [
"_templates",
]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
]
nitpicky = True
nitpick_ignore_regex = [
("py:class", "numpy._typing.*"),
("py:obj", "trimboth"), # python 3.11 error
("py:obj", "tmean"), # python 3.11 error
("py:obj", "subclass"), # python 3.11 error
("py:class", "typing.Any"), # python 3.11 error
# ('py:class', 'numpy.typing.ArrayLike')
("py:obj", "sqlalchemy.engine.Engine"), # ignore sqlalchemy
("py:class", "pipeline.Pipeline"), # nilearn
("py:obj", "neurokit2.*"), # ignore neurokit2
("py:obj", "datalad.*"), # ignore datalad
("py:obj", "junifer.*"), # ignore junifer internal
("py:class", "annotated_types.*") # ignore pydantic annotated types
]
# -- Options for HTML output -------------------------------------------------
html_theme = "furo"
html_title = "junifer documentation"
html_logo = "./images/junifer_logo.png"
# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
"css/custom.css",
]
html_js_files = [
"js/custom.js",
]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_sidebars = {
"**": [
"sidebar/scroll-start.html",
"sidebar/brand.html",
"sidebar/search.html",
"sidebar/navigation.html",
"versions.html",
"sidebar/ethical-ads.html",
"sidebar/scroll-end.html",
]
}
# -- sphinx.ext.autodoc configuration ----------------------------------------
autoclass_content = "both"
autodoc_typehints = "description"
autodoc_typehints_description_target = "documented"
# -- sphinx.ext.autosummary configuration ------------------------------------
autosummary_generate = True
# -- sphinx.ext.intersphinx configuration ------------------------------------
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"sklearn": ("https://scikit-learn.org/stable", None),
"nilearn": ("https://nilearn.github.io/stable/", None),
"julearn": ("https://juaml.github.io/julearn/main", None),
"nibabel": ("https://nipy.org/nibabel/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
# "sqlalchemy": ("https://docs.sqlalchemy.org/en/20/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"pydantic": ("https://docs.pydantic.dev/latest/", None),
}
# -- sphinx.ext.extlinks configuration ---------------------------------------
extlinks = {
"gh": (f"{github_repo_url}/issues/%s", "#%s"),
}
# -- numpydoc configuration --------------------------------------------------
numpydoc_show_class_members = False
numpydoc_xref_param_type = True
numpydoc_xref_aliases = {
"Path": "pathlib.Path",
"Nifti1Image": "nibabel.nifti1.Nifti1Image",
"Nifti2Image": "nibabel.nifti2.Nifti2Image",
# "Engine": "sqlalchemy.engine.Engine",
}
numpydoc_xref_ignore = {
"of",
"shape",
"optional",
"or",
"the",
"options",
"function",
"object",
"class",
"objects",
"Engine",
"positive",
"negative",
"estimator",
}
# numpydoc_validation_checks = {
# "all",
# "GL01",
# "GL02",
# "GL03",
# "ES01",
# "SA01",
# "EX01",
# }
# -- Sphinx-Gallery configuration --------------------------------------------
sphinx_gallery_conf = {
"examples_dirs": ["../examples"],
"gallery_dirs": ["auto_examples"],
"filename_pattern": "/(plot|run)_",
"backreferences_dir": "generated",
}
# -- sphinx-multiversion configuration ---------------------------------------
smv_rebuild_tags = False
smv_tag_whitelist = r"^v\d+\.\d+.\d+$"
smv_branch_whitelist = r"main"
smv_released_pattern = r"^tags/v.*$"
# -- sphinxcontrib-towncrier configuration -----------------------------------
towncrier_draft_autoversion_mode = "draft"
towncrier_draft_include_empty = True
towncrier_draft_working_directory = PROJECT_ROOT_DIR