[e7f7dd]: / docs / conf.py

Download this file

189 lines (168 with data), 6.6 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
# 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
# -- Path setup --------------------------------------------------------------
import sys
from datetime import datetime
from pathlib import Path
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import moscot
sys.path.insert(0, str(Path(__file__).parent / "extensions"))
# -- Project information -----------------------------------------------------
project = moscot.__name__
author = moscot.__author__
version = moscot.__version__
copyright = f"{datetime.now():%Y}, Theislab"
# -- 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 = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinxcontrib.bibtex",
"sphinx_copybutton",
"sphinx_autodoc_typehints",
"myst_nb",
"sphinx_design", # for cards
"sphinx_tippy",
"typed_returns",
]
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
"networkx": ("https://networkx.org/documentation/stable/", None),
"jax": ("https://jax.readthedocs.io/en/latest/", None),
"ott": ("https://ott-jax.readthedocs.io/en/latest/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"anndata": ("https://anndata.readthedocs.io/en/latest/", None),
"scanpy": ("https://scanpy.readthedocs.io/en/latest/", None),
"squidpy": ("https://squidpy.readthedocs.io/en/latest/", None),
"mudata": ("https://mudata.readthedocs.io/en/latest/", None),
}
master_doc = "index"
pygments_style = "tango"
pygments_dark_style = "monokai"
nitpicky = True
nitpick_ignore = [
("py:class", "numpy.float64"),
# see: https://github.com/numpy/numpydoc/issues/275
("py:class", "None. Remove all items from D."),
("py:class", "a set-like object providing a view on D's items"),
("py:class", "a set-like object providing a view on D's keys"),
("py:class", "v, remove specified key and return the corresponding value."), # noqa: E501
("py:class", "None. Update D from dict/iterable E and F."),
("py:class", "an object providing a view on D's values"),
("py:class", "a shallow copy of D"),
# ignore these classes until ott-jax adds them to their docs
("py:class", "ott.initializers.quadratic.initializers.BaseQuadraticInitializer"),
("py:class", "ott.initializers.linear.initializers.SinkhornInitializer"),
]
# TODO(michalk8): remove once typing has been cleaned-up
nitpick_ignore_regex = [
(r"py:class", r"moscot\..*(K|B|O)"),
(r"py:class", r"numpy\._typing.*"),
(r"py:class", r"moscot\..*Protocol.*"),
(
r"py:class",
r"moscot.base.output.BaseSolverOutput",
), # https://github.com/sphinx-doc/sphinx/issues/10974 means there is simply no way around this with generics
]
# bibliography
bibtex_bibfiles = ["references.bib"]
bibtex_reference_style = "author_year"
bibtex_default_style = "alpha"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
}
# myst
nb_execution_mode = "off"
myst_enable_extensions = [
"colon_fence",
"dollarmath",
"amsmath",
]
myst_heading_anchors = 3
# autodoc + napoleon
autosummary_generate = True
autodoc_member_order = "alphabetical"
autodoc_typehints = "description"
napoleon_google_docstring = False
napoleon_numpy_docstring = True
# spelling
spelling_lang = "en_US"
spelling_warning = True
spelling_word_list_filename = "spelling_wordlist.txt"
spelling_add_pypi_package_names = True
spelling_exclude_patterns = ["references.rst"]
# see: https://pyenchant.github.io/pyenchant/api/enchant.tokenize.html
spelling_filters = [
"enchant.tokenize.URLFilter",
"enchant.tokenize.EmailFilter",
"enchant.tokenize.MentionFilter",
]
# hover
tippy_anchor_parent_selector = "div.content"
tippy_enable_mathjax = True
# no need because of sphinxcontrib-bibtex
tippy_enable_doitips = False
linkcheck_report_timeouts_as_broken = True
linkcheck_ignore = [
# 403 Client Error
r"https://doi.org/10.1126/science.aad0501",
r"https://resources.aertslab.org/cistarget/tf_lists/",
r"https://doi.org/10.1126/science.aax1971",
r"https://doi.org/10.1093/nar/gkac235",
r"https://www.science.org/doi/abs/10.1126/science.aax1971",
r"https://doi.org/10.1101/2022.01.10.475692",
r"https://www.biorxiv.org/content/10.1101/2023.04.14.536867v1",
r"https://www.biorxiv.org/content/10.1101/2023.05.11.540374v2",
r"https://www.biorxiv.org/content/early/2022/01/11/2022.01.10.475692",
r"https://doi.org/10.1145/2516971.2516977",
r"https://doi.org/10.3390/a13090212",
r"https://www.mdpi.com/1999-4893/13/9/212",
]
exclude_patterns = ["_build", "**.ipynb_checkpoints", "notebooks/README.rst", "notebooks/CONTRIBUTING.rst"]
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "furo"
html_static_path = ["_static"]
html_css_files = [
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css",
]
html_show_sphinx = False
html_show_sourcelink = False
html_theme_options = {
"sidebar_hide_name": True,
"light_logo": "img/light_mode_logo.png",
"dark_logo": "img/dark_mode_logo.png",
"light_css_variables": {
"color-brand-primary": "#003262",
"color-brand-content": "#003262",
"admonition-font-size": "var(--font-size-normal)",
"admonition-title-font-size": "var(--font-size-normal)",
"code-font-size": "var(--font-size--small)",
},
"footer_icons": [
{
"name": "GitHub",
"url": "https://github.com/theislab/moscot",
"html": "",
"class": "fab fa-github",
},
],
}