Debian Codegraph @

doc/conf.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2 #
3 # scikit-misc documentation build configuration file,
4 # created by sphinx-quickstart on Wed Dec 23 22:32:29 2015.
5 #
6 # This file is execfile()d with the current directory set to its
7 # containing dir.
8 #
9 # Note that not all possible configuration values are present in this
10 # autogenerated file.
11 #
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
14
15 import os
16 import sys
17
18 on_rtd = os.environ.get('READTHEDOCS') == 'True'
19 # If extensions (or modules to document with autodoc) are in another directory,
20 # add these directories to sys.path here. If the directory is relative to the
21 # documentation root, use os.path.abspath to make it absolute, like shown here.
22 sys.path.insert(0, os.path.abspath('.'))
23
24 if on_rtd:
25 import mock
26 sys.path.insert(0, os.path.abspath('..'))
27 MOCK_MODULES = []
28 for mod_name in MOCK_MODULES:
29 sys.modules[mod_name] = mock.Mock()
30
31 # -- General configuration ------------------------------------------------
32
33 # If your documentation needs a minimal Sphinx version, state it here.
34 needs_sphinx = '6.1.3'
35
36 # Add any Sphinx extension module names here, as strings. They can be
37 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
38 # ones.
39 extensions = [
40 'sphinx.ext.autodoc',
41 'sphinx.ext.doctest',
42 'sphinx.ext.extlinks',
43 'sphinx.ext.intersphinx',
44 'sphinx.ext.todo',
45 'sphinx.ext.coverage',
46 'sphinx.ext.mathjax',
47 'sphinx.ext.ifconfig',
48 'sphinx.ext.viewcode',
49 'sphinx.ext.autosummary',
50 'sphinx.ext.githubpages',
51
52 'sphinxext.inline_code_highlight',
53 'numpydoc',
54 ]
55
56 # Add any paths that contain templates here, relative to this directory.
57 templates_path = ['_templates']
58
59 # The suffix of source filenames.
60 source_suffix = '.rst'
61
62 # The encoding of source files.
63 # source_encoding = 'utf-8-sig'
64
65 # The master toctree document.
66 master_doc = 'index'
67
68 # General information about the project.
69 project = 'scikit-misc'
70 copyright = '2023, Hassan Kibirige'
71 github_repo_url = f'https://github.com/has2k1/{project}'
72
73 # The version info for the project you're documenting, acts as replacement for
74 # |version| and |release|, also used in various other places throughout the
75 # built documents.
76
77 # The short X.Y version.
78
79 try:
80 import skmisc
81 version = skmisc.__version__
82 except ImportError:
83 version = 'unknown'
84
85
86 # The full version, including alpha/beta/rc tags.
87 release = version
88
89 # The language for content autogenerated by Sphinx. Refer to documentation
90 # for a list of supported languages.
91 # language = None
92
93 # There are two options for replacing |today|: either, you set today to some
94 # non-false value, then it is used:
95 # today = ''
96
97 # Else, today_fmt is used as the format for a strftime call.
98 # today_fmt = '%B %d, %Y'
99
100 # List of patterns, relative to source directory, that match files and
101 # directories to ignore when looking for source files.
102 exclude_patterns = []
103
104 # The reST default role (used for this markup: `text`) to use for all
105 # documents.
106 # default_role = None
107
108 # If true, '()' will be appended to :func: etc. cross-reference text.
109 # add_function_parentheses = True
110
111 # If true, the current module name will be prepended to all description
112 # unit titles (such as .. function::).
113 # add_module_names = True
114
115 # If true, sectionauthor and moduleauthor directives will be shown in the
116 # output. They are ignored by default.
117 # show_authors = False
118
119 # The name of the Pygments (syntax highlighting) style to use.
120 pygments_style = 'sphinx'
121 highlight_language = 'python3'
122
123 # A list of ignored prefixes for module index sorting.
124 # modindex_common_prefix = []
125
126 # If true, keep warnings as "system message" paragraphs in the built documents.
127 # keep_warnings = False
128
129 # I want the sphinx-build -W to emit "warnings as errors" as part of my test
130 # & build infrastructure, to ensure that there are no mistakes in the
131 # documentation. New in 1.4.2
132 suppress_warnings = ['image.nonlocal_uri']
133
134 # -- Options for HTML output ----------------------------------------------
135
136 # The theme to use for HTML and HTML Help pages. See the documentation for
137 # a list of builtin themes.
138 html_theme = 'theme'
139
140 # Theme options are theme-specific and customize the look and feel of a theme
141 # further. For a list of options available for each theme, see the
142 # documentation.
143 # https://github.com/ryan-roemer/sphinx-bootstrap-theme
144 # Bootswatch (http://bootswatch.com/) theme.
145 html_theme_options = {
146 'navbar_title': 'scikit-misc',
147 'globaltoc_depth': 2,
148 'globaltoc_includehidden': 'true',
149 'source_link_position': 'footer',
150 'navbar_sidebarrel': False,
151 'navbar_links': [
152 ('API', 'api'),
153 ],
154 }
155
156 # Add any paths that contain custom themes here, relative to this directory.
157 html_theme_path = ['.']
158
159 # The name for this set of Sphinx documents. If None, it defaults to
160 # "<project> v<release> documentation".
161 # html_title = None
162
163 # A shorter title for the navigation bar. Default is the same as html_title.
164 # html_short_title = None
165
166 # The name of an image file (relative to this directory) to place at the top
167 # of the sidebar.
168 # html_logo = None
169
170 # The name of an image file (within the static path) to use as favicon of the
171 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
172 # pixels large.
173 # html_favicon = None
174
175 # Add any paths that contain custom static files (such as style sheets) here,
176 # relative to this directory. They are copied after the builtin static files,
177 # so a file named "default.css" will overwrite the builtin "default.css".
178 html_static_path = ['_static']
179
180 # Add any extra paths that contain custom files (such as robots.txt or
181 # .htaccess) here, relative to this directory. These files are copied
182 # directly to the root of the documentation.
183 # html_extra_path = []
184
185 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
186 # using the given strftime format.
187 # html_last_updated_fmt = '%b %d, %Y'
188
189 # If true, SmartyPants will be used to convert quotes and dashes to
190 # typographically correct entities.
191 # html_use_smartypants = True
192
193 # Custom sidebar templates, maps document names to template names.
194 # html_sidebars = {}
195
196 # Additional templates that should be rendered to pages, maps page names to
197 # template names.
198 # html_additional_pages = {}
199
200 # If false, no module index is generated.
201 # html_domain_indices = True
202
203 # If false, no index is generated.
204 # html_use_index = True
205
206 # If true, the index is split into individual pages for each letter.
207 # html_split_index = False
208
209 # If true, links to the reST sources are added to the pages.
210 # html_show_sourcelink = True
211
212 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
213 # html_show_sphinx = True
214
215 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
216 # html_show_copyright = True
217
218 # If true, an OpenSearch description file will be output, and all pages will
219 # contain a <link> tag referring to it. The value of this option must be the
220 # base URL from which the finished HTML is served.
221 # html_use_opensearch = ''
222
223 # This is the file name suffix for HTML files (e.g. ".xhtml").
224 # html_file_suffix = None
225
226 # Output file base name for HTML help builder.
227 htmlhelp_basename = 'scikit-misc-doc'
228
229
230 # -- Options for LaTeX output ---------------------------------------------
231 latex_elements = {
232 # The paper size ('letterpaper' or 'a4paper').
233 'papersize': 'a4paper',
234
235 # The font size ('10pt', '11pt' or '12pt').
236 'pointsize': '12pt',
237
238 # Additional stuff for the LaTeX preamble.
239 'preamble': r'''
240 \usepackage{charter}
241 \usepackage[defaultsans]{lato}
242 \usepackage{inconsolata}
243 ''',
244 }
245
246 # Grouping the document tree into LaTeX files. List of tuples
247 # (source start file, target name, title,
248 # author, documentclass [howto, manual, or own class]).
249 latex_documents = [
250 (master_doc, 'scikit-misc.tex',
251 'scikit-misc Documentation',
252 'Hassan Kibirige', 'manual'),
253 ]
254
255 # The name of an image file (relative to this directory) to place at the top of
256 # the title page.
257 # latex_logo = None
258
259 # For "manual" documents, if this is true, then toplevel headings are parts,
260 # not chapters.
261 # latex_use_parts = False
262
263 # If true, show page references after internal links.
264 # latex_show_pagerefs = False
265
266 # If true, show URL addresses after external links.
267 # latex_show_urls = False
268
269 # Documents to append as an appendix to all manuals.
270 # latex_appendices = []
271
272 # If false, no module index is generated.
273 # latex_domain_indices = True
274
275
276 # -- Options for manual page output ---------------------------------------
277
278 # One entry per manual page. List of tuples
279 # (source start file, name, description, authors, manual section).
280 man_pages = [
281 (master_doc, 'scikit-misc',
282 'The scikit-misc Documentation',
283 ['Hassan Kibirige'], 1)
284 ]
285
286 # If true, show URL addresses after external links.
287 # man_show_urls = False
288
289
290 # -- Options for Texinfo output -------------------------------------------
291
292 # Grouping the document tree into Texinfo files. List of tuples
293 # (source start file, target name, title, author,
294 # dir menu entry, description, category)
295 texinfo_documents = [
296 (master_doc, 'scikit-misc',
297 'The scikit-misc Documentation',
298 'Hassan Kibirige',
299 'Miscellaneous tools for scientific computing',
300 ),
301 ]
302
303 # Documents to append as an appendix to all manuals.
304 # texinfo_appendices = []
305
306 # If false, no module index is generated.
307 # texinfo_domain_indices = True
308
309 # How to display URL addresses: 'footnote', 'no', or 'inline'.
310 # texinfo_show_urls = 'footnote'
311
312 # If true, do not generate a @detailmenu in the "Top" node's menu.
313 # texinfo_no_detailmenu = False
314
315
316 # Example configuration for intersphinx: refer to the Python standard library.
317 intersphinx_mapping = {
318 'python': ('https://docs.python.org/3/', None),
319 'numpy': ('https://numpy.org/doc/stable/', None),
320 }
321
322
323 # -- Extension configuration ----------------------------------------------
324 autodoc_member_order = 'bysource'
325 autosummary_generate = True
326
327
328 extlinks = {
329 'issue': (f'{github_repo_url}/issues/%s', '#%s'),
330 'pr': (f'{github_repo_url}/pul/%s', 'PR #%s')
331 }
332
333 # numpydoc
334 numpydoc_show_class_members = False
335 numpydoc_class_members_toctree = False
336 numpydoc_xref_param_type = True
337 numpydoc_xref_aliases = {
338 # python
339 'sequence': ':term:`python:sequence`',
340 'iterable': ':term:`python:iterable`',
341 'string': 'str',
342 'tuples': 'tuple',
343 'boolean': 'bool',
344 # numpy
345 'array': 'numpy.ndarray',
346 'np.array': 'numpy.ndarray',
347 'ndarray': 'numpy.ndarray',
348 'array-like': ':term:`array-like<numpy:array_like>`',
349 'array_like': ':term:`numpy:array_like`',
350 # pandas
351 'dataframe': 'pandas.DataFrame',
352 'DataFrame': 'pandas.DataFrame',
353 'Series': 'pandas.Series',
354 'series': 'pandas.Series',
355 }
356
357 numpydoc_xref_ignore = {'type', 'optional', 'default'}
358
359
360 def setup(app):
361 app.add_js_file('copybutton.js')