Skip to content

Commit

Permalink
Use multiprocessing to get number of cores for parallel docs build.
Browse files Browse the repository at this point in the history
  • Loading branch information
moorepants committed Mar 1, 2025
1 parent 5d58666 commit a91d709
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#
import os
import sys
import multiprocessing
sys.path.insert(0, os.path.abspath('..'))
import opty

Expand Down Expand Up @@ -100,7 +101,8 @@

# Sphinx >=4 default to MathJax v3, but v3 does not support wrapping lines. So
# force Sphinx to use v2 and config MathJax to wrap long lines.
mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
mathjax_path = ("https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"
"?config=TeX-AMS-MML_HTMLorMML")
mathjax2_config = {
"HTML-CSS": {
"linebreaks": {"automatic": True}
Expand All @@ -113,7 +115,7 @@
'examples_dirs': os.path.join(REPO_DIR, 'examples-gallery'),
'gallery_dirs': 'examples',
'matplotlib_animations': True,
'parallel': True,
'parallel': multiprocessing.cpu_count(),
'remove_config_comments': True,
}

Expand Down Expand Up @@ -185,7 +187,7 @@ def sort_subsections(path):
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
# html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------
Expand Down

0 comments on commit a91d709

Please sign in to comment.