Debian Codegraph @

docs/source/conf.py

raw ◀ ▶
Source reconstructed at patch state 0 of 5 — not the installed (fully patched) source.
5 Debian patches touch this file
1 #
2 # dask documentation build configuration file, created by
3 # sphinx-quickstart on Sun Jan 4 08:58:22 2015.
4 #
5 # This file is execfile()d with the current directory set to its containing dir.
6 #
7 # Note that not all possible configuration values are present in this
8 # autogenerated file.
9 #
10 # All configuration values have a default; values that are commented out
11 # serve to show the default.
12
13 from __future__ import annotations
14
15 import os
16
17 # Build docs with option disabled until we move dask-expr over, otherwise
18 # we run into a lot of circular issues that sphinx can't resolve properly
19 os.environ["DASK_DATAFRAME__QUERY_PLANNING"] = "false"
20
21 # Add any Sphinx extension module names here, as strings. They can be extensions
22 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
23 import sys
24
25 import sphinx_autosummary_accessors
26
27 # -- General configuration -----------------------------------------------------
28
29 # If your documentation needs a minimal Sphinx version, state it here.
30 # needs_sphinx = '1.0'
31
32
33 # If extensions (or modules to document with autodoc) are in another directory,
34 # add these directories to sys.path here. If the directory is relative to the
35 # documentation root, use os.path.abspath to make it absolute, like shown here.
36 sys.path.insert(0, os.path.abspath("../../"))
37
38 extensions = [
39 "sphinx.ext.autodoc",
40 "sphinx.ext.doctest",
41 "sphinx.ext.mathjax",
42 "sphinx.ext.intersphinx",
43 "sphinx.ext.autosummary",
44 "sphinx_autosummary_accessors",
45 "sphinx.ext.extlinks",
46 "sphinx.ext.viewcode",
47 "numpydoc",
48 "sphinx_click.ext",
49 "dask_sphinx_theme.ext.dask_config_sphinx_ext",
50 "sphinx_tabs.tabs",
51 "sphinx_remove_toctrees",
52 "IPython.sphinxext.ipython_console_highlighting",
53 "IPython.sphinxext.ipython_directive",
54 "jupyter_sphinx",
55 "sphinx_copybutton",
56 "sphinx_design",
57 ]
58
59 copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
60 copybutton_prompt_is_regexp = True
61
62 numpydoc_show_class_members = False
63
64 sphinx_tabs_disable_tab_closing = True
65
66 # Remove individual API pages from sphinx toctree to prevent long build times.
67 # See https://github.com/dask/dask/issues/8227.
68 remove_from_toctrees = ["generated/*"]
69
70 # Add any paths that contain templates here, relative to this directory.
71 templates_path = ["_templates", sphinx_autosummary_accessors.templates_path]
72
73 # The suffix of source filenames.
74 source_suffix = ".rst"
75
76 # The encoding of source files.
77 # source_encoding = 'utf-8-sig'
78
79 # The master toctree document.
80 master_doc = "index"
81
82 # General information about the project.
83 project = "Dask"
84 copyright = "2014-2018, Anaconda, Inc. and contributors"
85
86 # The language for content autogenerated by Sphinx. Refer to documentation
87 # for a list of supported languages.
88 # language = None
89
90 # There are two options for replacing |today|: either, you set today to some
91 # non-false value, then it is used:
92 # today = ''
93 # Else, today_fmt is used as the format for a strftime call.
94 # today_fmt = '%B %d, %Y'
95
96 # List of patterns, relative to source directory, that match files and
97 # directories to ignore when looking for source files.
98 exclude_patterns: list[str] = []
99
100 # The reST default role (used for this markup: `text`) to use for all documents.
101 # default_role = None
102
103 # If true, '()' will be appended to :func: etc. cross-reference text.
104 # add_function_parentheses = True
105
106 # If true, the current module name will be prepended to all description
107 # unit titles (such as .. function::).
108 # add_module_names = True
109
110 # If true, sectionauthor and moduleauthor directives will be shown in the
111 # output. They are ignored by default.
112 # show_authors = False
113
114 # The name of the Pygments (syntax highlighting) style to use.
115 # Commenting this out for now, if we register dask pygments,
116 # then eventually this line can be:
117 # pygments_style = "dask"
118
119 # A list of ignored prefixes for module index sorting.
120 # modindex_common_prefix = []
121
122
123 # -- Options for HTML output ---------------------------------------------------
124
125 html_theme = "dask_sphinx_theme"
126
127 # Theme options are theme-specific and customize the look and feel of a theme
128 # further. For a list of options available for each theme, see the
129 # documentation.
130 html_theme_options = {"logo_only": True}
131
132 # Add any paths that contain custom themes here, relative to this directory.
133 # html_theme_path = []
134
135 # The name for this set of Sphinx documents. If None, it defaults to
136 # "<project> v<release> documentation".
137 # html_title = None
138
139 # A shorter title for the navigation bar. Default is the same as html_title.
140 # html_short_title = None
141
142 # The name of an image file (relative to this directory) to place at the top
143 # of the sidebar.
144 # html_logo = "images/dask_horizontal_white_no_pad.svg"
145
146
147 # The name of an image file (within the static path) to use as favicon of the
148 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
149 # pixels large.
150 # html_favicon = None
151
152 # Add any paths that contain custom static files (such as style sheets) here,
153 # relative to this directory. They are copied after the builtin static files,
154 # so a file named "default.css" will overwrite the builtin "default.css".
155 html_static_path = ["_static"]
156
157 html_js_files = ["custom.js"]
158
159 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
160 # using the given strftime format.
161 # html_last_updated_fmt = '%b %d, %Y'
162
163 # If true, SmartyPants will be used to convert quotes and dashes to
164 # typographically correct entities.
165 # html_use_smartypants = True
166
167 # Custom sidebar templates, maps document names to template names.
168 # html_sidebars = {}
169
170 # Additional templates that should be rendered to pages, maps page names to
171 # template names.
172 # html_additional_pages = {}
173
174 # If false, no module index is generated.
175 # html_domain_indices = True
176
177 # If false, no index is generated.
178 # html_use_index = True
179
180 # If true, the index is split into individual pages for each letter.
181 # html_split_index = False
182
183 # If true, links to the reST sources are added to the pages.
184 # html_show_sourcelink = True
185
186 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
187 # html_show_sphinx = True
188
189 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
190 # html_show_copyright = True
191
192 # If true, an OpenSearch description file will be output, and all pages will
193 # contain a <link> tag referring to it. The value of this option must be the
194 # base URL from which the finished HTML is served.
195 # html_use_opensearch = ''
196
197 # This is the file name suffix for HTML files (e.g. ".xhtml").
198 # html_file_suffix = None
199
200 # Output file base name for HTML help builder.
201 htmlhelp_basename = "daskdoc"
202
203
204 # -- Options for LaTeX output --------------------------------------------------
205
206 latex_elements: dict[str, str] = {
207 # The paper size ('letterpaper' or 'a4paper').
208 #'papersize': 'letterpaper',
209 # The font size ('10pt', '11pt' or '12pt').
210 #'pointsize': '10pt',
211 # Additional stuff for the LaTeX preamble.
212 #'preamble': '',
213 }
214
215 # Grouping the document tree into LaTeX files. List of tuples
216 # (source start file, target name, title, author, documentclass [howto/manual]).
217 latex_documents = [
218 (master_doc, "dask.tex", "dask Documentation", "Dask Development Team", "manual")
219 ]
220
221 # The name of an image file (relative to this directory) to place at the top of
222 # the title page.
223 # latex_logo = None
224
225 # For "manual" documents, if this is true, then toplevel headings are parts,
226 # not chapters.
227 # latex_use_parts = False
228
229 # If true, show page references after internal links.
230 # latex_show_pagerefs = False
231
232 # If true, show URL addresses after external links.
233 # latex_show_urls = False
234
235 # Documents to append as an appendix to all manuals.
236 # latex_appendices = []
237
238 # If false, no module index is generated.
239 # latex_domain_indices = True
240
241
242 # -- Options for manual page output --------------------------------------------
243
244 # One entry per manual page. List of tuples
245 # (source start file, name, description, authors, manual section).
246 man_pages = [(master_doc, "dask", "dask Documentation", ["Dask Development Team"], 1)]
247
248 # If true, show URL addresses after external links.
249 # man_show_urls = False
250
251
252 # -- Options for Texinfo output ------------------------------------------------
253
254 # Grouping the document tree into Texinfo files. List of tuples
255 # (source start file, target name, title, author,
256 # dir menu entry, description, category)
257 texinfo_documents = [
258 (
259 master_doc,
260 "Dask",
261 "dask Documentation",
262 "Dask Development Team",
263 "Dask",
264 "One line description of project.",
265 "Miscellaneous",
266 )
267 ]
268
269 # Documents to append as an appendix to all manuals.
270 # texinfo_appendices = []
271
272 # If false, no module index is generated.
273 # texinfo_domain_indices = True
274
275 # How to display URL addresses: 'footnote', 'no', or 'inline'.
276 # texinfo_show_urls = 'footnote'
277
278
279 # -- Options for Epub output ---------------------------------------------------
280
281 # Bibliographic Dublin Core info.
282 epub_title = "Dask"
283 epub_author = "Dask Development Team"
284 epub_publisher = "Anaconda Inc"
285 epub_copyright = "2014-2018, Anaconda, Inc. and contributors"
286
287 # The language of the text. It defaults to the language option
288 # or en if the language is not set.
289 # epub_language = ''
290
291 # The scheme of the identifier. Typical schemes are ISBN or URL.
292 # epub_scheme = ''
293
294 # The unique identifier of the text. This can be a ISBN number
295 # or the project homepage.
296 # epub_identifier = ''
297
298 # A unique identification for the text.
299 # epub_uid = ''
300
301 # A tuple containing the cover image and cover page html template filenames.
302 # epub_cover = ()
303
304 # HTML files that should be inserted before the pages created by sphinx.
305 # The format is a list of tuples containing the path and title.
306 # epub_pre_files = []
307
308 # HTML files that should be inserted after the pages created by sphinx.
309 # The format is a list of tuples containing the path and title.
310 # epub_post_files = []
311
312 # A list of files that should not be packed into the epub file.
313 # epub_exclude_files = []
314
315 # The depth of the table of contents in toc.ncx.
316 # epub_tocdepth = 3
317
318 # Allow duplicate toc entries.
319 # epub_tocdup = True
320
321 extlinks = {
322 "issue": ("https://github.com/dask/dask/issues/%s", "dask#"),
323 "pr": ("https://github.com/dask/dask/pull/%s", "dask#"),
324 "pr-distributed": ("https://github.com/dask/distributed/pull/%s", "distributed#"),
325 "pr-expr": ("https://github.com/dask/dask-expr/pull/%s", "dask-expr#"),
326 }
327
328 # --Options for sphinx extensions -----------------------------------------------
329
330 intersphinx_mapping = {
331 "python": ("https://docs.python.org/3/", None),
332 "pandas": (
333 "https://pandas.pydata.org/pandas-docs/stable/",
334 "https://pandas.pydata.org/pandas-docs/stable/objects.inv",
335 ),
336 "numpy": (
337 "https://numpy.org/doc/stable/",
338 "https://numpy.org/doc/stable/objects.inv",
339 ),
340 "asyncssh": (
341 "https://asyncssh.readthedocs.io/en/latest/",
342 "https://asyncssh.readthedocs.io/en/latest/objects.inv",
343 ),
344 "distributed": ("https://distributed.dask.org/en/latest", None),
345 "pyarrow": ("https://arrow.apache.org/docs/", None),
346 "zarr": (
347 "https://zarr.readthedocs.io/en/latest/",
348 "https://zarr.readthedocs.io/en/latest/objects.inv",
349 ),
350 "skimage": ("https://scikit-image.org/docs/dev/", None),
351 "fsspec": (
352 "https://filesystem-spec.readthedocs.io/en/latest/",
353 "https://filesystem-spec.readthedocs.io/en/latest/objects.inv",
354 ),
355 "click": ("https://click.palletsprojects.com/", None),
356 "scipy": ("https://docs.scipy.org/doc/scipy", None),
357 }
358
359 # Redirects
360 # https://tech.signavio.com/2017/managing-sphinx-redirects
361 redirect_files = [
362 # old html, new html
363 ("bytes.html", "remote-data-services.html"),
364 ("array-overview.html", "array.html"),
365 ("array-ghost.html", "array-overlap.html"),
366 ("dataframe-overview.html", "dataframe.html"),
367 ("dataframe-performance.html", "dataframe-best-practices.html"),
368 ("delayed-overview.html", "delayed.html"),
369 ("educational-resources.html", "presentations.html"),
370 ("scheduler-choice.html", "setup.html"),
371 ("diagnostics.html", "diagnostics-local.html"),
372 ("inspect.html", "graphviz.html"),
373 ("funding.html", "https://dask.org/#supported-by"),
374 ("examples-tutorials.html", "https://examples.dask.org"),
375 ("examples/array-extend.html", "https://examples.dask.org"),
376 ("examples/array-hdf5.html", "https://examples.dask.org"),
377 ("examples/array-numpy.html", "https://examples.dask.org"),
378 ("examples/array-random.html", "https://examples.dask.org"),
379 ("examples/bag-json.html", "https://examples.dask.org"),
380 ("examples/bag-word-count-hdfs.html", "https://examples.dask.org"),
381 ("examples/dataframe-csv.html", "https://examples.dask.org"),
382 ("examples/dataframe-hdf5.html", "https://examples.dask.org"),
383 ("examples/delayed-array.html", "https://examples.dask.org"),
384 ("examples/delayed-custom.html", "https://examples.dask.org"),
385 ("docs.html", "index.html"),
386 ("use-cases.html", "https://stories.dask.org"),
387 ("bag-overview.html", "bag.html"),
388 ("distributed.html", "https://distributed.dask.org"),
389 ("institutional-faq.html", "faq.html"),
390 ("cite.html", "faq.html#how-do-I-cite-dask"),
391 ("remote-data-services.html", "how-to/connect-to-remote-data.html"),
392 ("debugging.html", "how-to/debug.html"),
393 ("setup.html", "deploying.html"),
394 ("how-to/deploy-dask-clusters.html", "deploying.html"),
395 ("setup/cli.html", "deploying-cli.html"),
396 ("how-to/deploy-dask/cli.html", "deploying-cli.html"),
397 ("setup/cloud.html", "deploying-cloud.html"),
398 ("how-to/deploy-dask/cloud.html", "deploying-cloud.html"),
399 ("setup/docker.html", "hdeploying-docker.html"),
400 ("how-to/deploy-dask/docker.html", "deploying-docker.html"),
401 ("setup/hpc.html", "deploying-hpc.html"),
402 ("how-to/deploy-dask/hpc.html", "deploying-hpc.html"),
403 ("setup/kubernetes.html", "deploying-kubernetes.html"),
404 ("how-to/deploy-dask/kubernetes.html", "deploying-kubernetes.html"),
405 ("setup/python-advanced.html", "deploying-python-advanced.html"),
406 ("how-to/deploy-dask/python-advanced.html", "deploying-python-advanced.html"),
407 ("setup/single-distributed.html", "deploying-python.html"),
408 ("how-to/deploy-dask/single-distributed.html", "deploying-python.html"),
409 ("setup/single-machine.html", "scheduling.html"),
410 ("how-to/deploy-dask/single-machine.html", "scheduling.html"),
411 ("setup/ssh.html", "deploying-ssh.html"),
412 ("how-to/deploy-dask/ssh.html", "deploying-ssh.html"),
413 ("setup/adaptive.html", "how-to/adaptive.html"),
414 ("how-to/adaptive.html", "adaptive.html"),
415 ("setup/custom-startup.html", "how-to/customize-initialization.html"),
416 ("setup/environment.html", "how-to/manage-environments.html"),
417 ("how-to/manage-environments.html", "software-environments.html"),
418 ("setup/prometheus.html", "how-to/setup-prometheus.html"),
419 ("how-to/setup-prometheus.html", "prometheus.html"),
420 ]
421
422
423 redirect_template = """\
424 <html>
425 <head>
426 <meta http-equiv="refresh" content="1; url={new}" />
427 <script>
428 window.location.href = "{new}"
429 </script>
430 </head>
431 </html>
432 """
433
434 # Rate limiting issue for github: https://github.com/sphinx-doc/sphinx/issues/7388
435 linkcheck_ignore = [
436 r"^https?:\/\/(?:www\.)?github.com\/",
437 r"^https?:\/\/localhost(?:[:\/].+)?$",
438 ]
439
440 doctest_global_setup = """
441 import numpy as np
442 """
443
444
445 def copy_legacy_redirects(app, docname):
446 if app.builder.name == "html":
447 for html_src_path, new in redirect_files:
448 # add ../ to old nested paths
449 new = f"{'../' * html_src_path.count('/')}{new}"
450 page = redirect_template.format(new=new)
451 target_path = app.outdir + "/" + html_src_path
452 os.makedirs(os.path.dirname(target_path), exist_ok=True)
453 with open(target_path, "w") as f:
454 f.write(page)
455
456
457 def setup(app):
458 app.connect("build-finished", copy_legacy_redirects)