forked from scverse/scanpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.py
153 lines (127 loc) · 5 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
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
import os
import sys
import warnings
from pathlib import Path
from datetime import datetime
import matplotlib # noqa
# Don’t use tkinter agg when importing scanpy → … → matplotlib
matplotlib.use('agg')
HERE = Path(__file__).parent
sys.path[:0] = [str(HERE.parent), str(HERE / 'extensions')]
import scanpy # noqa
on_rtd = os.environ.get('READTHEDOCS') == 'True'
# -- General configuration ------------------------------------------------
nitpicky = True # Warn about broken links. This is here for a reason: Do not change.
needs_sphinx = '2.0' # Nicer param docs
suppress_warnings = ['ref.citation']
# General information
project = 'Scanpy'
author = scanpy.__author__
copyright = f'{datetime.now():%Y}, {author}.'
version = scanpy.__version__.replace('.dirty', '')
release = version
# default settings
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
default_role = 'literal'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = 'sphinx'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.autosummary',
# 'plot_generator',
# 'plot_directive',
'sphinx_autodoc_typehints', # needs to be after napoleon
# 'ipython_directive',
# 'ipython_console_highlighting',
'scanpydoc',
*[p.stem for p in (HERE / 'extensions').glob('*.py')],
]
# Generate the API documentation when building
autosummary_generate = True
autodoc_member_order = 'bysource'
# autodoc_default_flags = ['members']
napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_use_rtype = True # having a separate entry generally helps readability
napoleon_use_param = True
napoleon_custom_sections = [('Params', 'Parameters')]
todo_include_todos = False
api_dir = HERE / 'api' # function_images
scanpy_tutorials_url = 'https://scanpy-tutorials.readthedocs.io/en/latest/'
intersphinx_mapping = dict(
anndata=('https://anndata.readthedocs.io/en/stable/', None),
bbknn=('https://bbknn.readthedocs.io/en/latest/', None),
cycler=('https://matplotlib.org/cycler/', None),
h5py=('http://docs.h5py.org/en/stable/', None),
ipython=('https://ipython.readthedocs.io/en/stable/', None),
leidenalg=('https://leidenalg.readthedocs.io/en/latest/', None),
louvain=('https://louvain-igraph.readthedocs.io/en/latest/', None),
matplotlib=('https://matplotlib.org/', None),
networkx=('https://networkx.github.io/documentation/networkx-1.10/', None),
numpy=('https://docs.scipy.org/doc/numpy/', None),
pandas=('https://pandas.pydata.org/pandas-docs/stable/', None),
python=('https://docs.python.org/3', None),
scipy=('https://docs.scipy.org/doc/scipy/reference/', None),
scvelo=('https://scvelo.readthedocs.io/', None),
seaborn=('https://seaborn.pydata.org/', None),
sklearn=('https://scikit-learn.org/stable/', None),
scanpy_tutorials=(scanpy_tutorials_url, None),
)
# -- Options for HTML output ----------------------------------------------
html_theme = 'scanpydoc'
html_theme_options = dict(navigation_depth=4, logo_only=True) # Only show the logo
html_context = dict(
display_github=True, # Integrate GitHub
github_user='theislab', # Username
github_repo='scanpy', # Repo name
github_version='master', # Version
conf_py_path='/docs/', # Path in the checkout to the docs root
)
html_static_path = ['_static']
html_show_sphinx = False
html_logo = '_static/img/Scanpy_Logo_BrightFG.svg'
def setup(app):
app.warningiserror = on_rtd
# -- Options for other output formats ------------------------------------------
htmlhelp_basename = f'{project}doc'
doc_title = f'{project} Documentation'
latex_documents = [(master_doc, f'{project}.tex', doc_title, author, 'manual')]
man_pages = [(master_doc, project, doc_title, [author], 1)]
texinfo_documents = [
(
master_doc,
project,
doc_title,
author,
project,
'One line description of project.',
'Miscellaneous',
)
]
# -- Suppress link warnings ----------------------------------------------------
qualname_overrides = {
"sklearn.neighbors.dist_metrics.DistanceMetric": "sklearn.neighbors.DistanceMetric",
# If the docs are built with an old version of numpy, this will make it work:
"numpy.random.RandomState": "numpy.random.mtrand.RandomState",
"scanpy.plotting._matrixplot.MatrixPlot": "scanpy.pl.MatrixPlot",
"scanpy.plotting._dotplot.DotPlot": "scanpy.pl.DotPlot",
"scanpy.plotting._stacked_violin.StackedViolin": "scanpy.pl.StackedViolin",
}
nitpick_ignore = [
# Will probably be documented
('py:class', 'scanpy._settings.Verbosity'),
# Currently undocumented: https://github.com/mwaskom/seaborn/issues/1810
('py:class', 'seaborn.ClusterGrid'),
# Won’t be documented
('py:class', 'scanpy.plotting._utils._AxesSubplot'),
('py:class', 'scanpy._utils.Empty'),
('py:class', 'numpy.random.mtrand.RandomState'),
]