mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Avoid mocking many third-party packages when building documentation
This commit is contained in:
parent
d7aaf003bb
commit
d276fb590d
2 changed files with 7 additions and 10 deletions
|
|
@ -3,3 +3,9 @@ jupyter
|
|||
sphinxcontrib-katex
|
||||
sphinxcontrib-svg2pdfconverter
|
||||
nbsphinx
|
||||
numpy
|
||||
scipy
|
||||
h5py
|
||||
pandas
|
||||
uncertainties
|
||||
matplotlib
|
||||
|
|
|
|||
|
|
@ -21,19 +21,10 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
|||
from unittest.mock import MagicMock
|
||||
|
||||
MOCK_MODULES = [
|
||||
'numpy', 'numpy.polynomial', 'numpy.polynomial.polynomial',
|
||||
'numpy.ctypeslib', 'scipy', 'scipy.sparse', 'scipy.sparse.linalg',
|
||||
'scipy.interpolate', 'scipy.integrate', 'scipy.optimize', 'scipy.signal',
|
||||
'scipy.special', 'scipy.stats', 'scipy.spatial', 'h5py', 'pandas',
|
||||
'uncertainties', 'matplotlib', 'matplotlib.pyplot', 'openmoc',
|
||||
'openmc.data.reconstruct', 'openmc.checkvalue'
|
||||
'openmoc', 'openmc.data.reconstruct',
|
||||
]
|
||||
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)
|
||||
|
||||
import numpy as np
|
||||
np.ndarray = MagicMock
|
||||
np.polynomial.Polynomial = MagicMock
|
||||
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue