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