-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.py
90 lines (81 loc) · 2.28 KB
/
conf.py
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
import cmdstanpy
from sphinx.application import Sphinx
project = "gptools"
extensions = [
"matplotlib.sphinxext.plot_directive",
"myst_nb",
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinxcontrib.stan",
]
napoleon_custom_sections = [("Returns", "params_style")]
plot_formats = [
("png", 144),
]
html_theme = "sphinx_book_theme"
html_theme_options = {
"repository_url": "https://github.com/onnela-lab/gptools",
"use_repository_button": True,
}
exclude_patterns = [
".pytest_cache",
"**.ipynb_checkpoints",
"**/cran-comments.md",
"**/LICENSE.md",
"**/NEWS.md",
"**/README.md",
"docs/_build",
"docs/jupyter_execute",
"figures",
"playground",
"README.md",
"venv",
]
# Configure autodoc to avoid excessively long fully-qualified names.
add_module_names = False
autodoc_typehints_format = "short"
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"cmdstanpy": (
f"https://cmdstanpy.readthedocs.io/en/v{cmdstanpy.__version__}",
None,
),
}
source_suffix = {
".rst": "restructuredtext",
}
nb_execution_mode = "cache"
nb_execution_timeout = 300 # Some examples take a while to compile and sample.
nb_execution_allow_errors = False
nb_execution_raise_on_error = True
myst_enable_extensions = [
"amsmath",
"dollarmath",
]
myst_dmath_double_inline = True
mathjax3_config = {
"tex": {
"macros": {
"BigO": r"\mathcal{O}",
"braces": [r"\left\{#1\right\}", 1],
"cov": r"\operatorname{cov}",
"dist": r"\sim",
"E": [r"\mathbb{E}\parenth{#1}", 1],
"imag": r"\mathrm{i}",
"mat": [r"\mathbf{#1}", 1],
"parenth": [r"\left(#1\right)", 1],
"pred": r"\mathcal{P}",
"proba": [r"p\parenth{#1}", 1],
}
}
}
def setup(app: Sphinx) -> None:
# Ignore .ipynb and .html files (cf.
# https://github.com/executablebooks/MyST-NB/issues/363).
app.registry.source_suffix.pop(".ipynb", None)
app.registry.source_suffix.pop(".html", None)