DiamondLightSource / httomo

High-throughput tomography pipeline
https://diamondlightsource.github.io/httomo/
Other
7 stars 4 forks source link

Lots of warnings when building docs locally #468

Closed yousefmoazzam closed 1 month ago

yousefmoazzam commented 1 month ago

As of 01a5f30, there are a lot of warnings when building the docs locally.

Amusingly, the full error output is too long to put in a post (the limit to the length of a post is 65536 characters, and the full output exceeds that), so I will only a post a snippet of the warnings.

There are two main type of warning, one is the following (I'm able to post the full thing, since this part isn't too long):

Running Sphinx v4.5.0
loading translations [en]... done
making output directory... done
[autosummary] generating autosummary for: api/httomo.base_block.rst, api/httomo.block-concrete.rst, api/httomo.block_interfaces.rst, api/httomo.cli.rst, api/httomo.cli_utils.rst, api/httomo.cufft.rst, api/httomo.darks_flats.rst, api/httomo.data.dataset_store.rst, api/httomo.data.hdf.loaders.rst, api/httomo.data.hdf.rst, ..., introduction/indepth/chunks.rst, introduction/indepth/detailed_about.rst, introduction/indepth/memory_estimators.rst, introduction/indepth/reslice.rst, introduction/indepth/sections.rst, introduction/indepth/wrappers.rst, pipelines/yaml.rst, reference/loaders.rst, reference/yaml.rst, utilities/yaml_checker.rst
Failed to import httomo.runner.method_wrapper.
Possible hints:
* AttributeError: module 'httomo.runner' has no attribute 'method_wrapper'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.transform_layer.
Possible hints:
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
* AttributeError: module 'httomo' has no attribute 'transform_layer'
Failed to import httomo.ui_layer.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'ui_layer'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.method_wrappers.reconstruction.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.method_wrappers.dezinging.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.methods.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'methods'
* ModuleNotFoundError: No module named 'hdf5plugin'
Failed to import httomo.sweep_runner.stages.
Possible hints:
* AttributeError: module 'httomo.sweep_runner' has no attribute 'stages'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.method_wrappers.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.sweep_runner.param_sweep_runner.
Possible hints:
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
* AttributeError: module 'httomo.sweep_runner' has no attribute 'param_sweep_runner'
Failed to import httomo.runner.dataset_store_interfaces.
Possible hints:
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
* AttributeError: module 'httomo.runner' has no attribute 'dataset_store_interfaces'
Failed to import httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.prep.phase.
Possible hints:
* AttributeError: module 'httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.prep' has no attribute 'phase'
* OSError: cufft library not found
Failed to import httomo.runner.dataset.
Possible hints:
* AttributeError: module 'httomo.runner' has no attribute 'dataset'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.runner.dataset_store_backing.
Possible hints:
* ModuleNotFoundError: No module named 'numpy.typing'; 'numpy' is not a package
* AttributeError: module 'httomo.runner' has no attribute 'dataset_store_backing'
Failed to import httomo.runner.loader.
Possible hints:
* AttributeError: module 'httomo.runner' has no attribute 'loader'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.transform_loader_params.
Possible hints:
* TypeError: unsupported operand type(s) for |: 'Mock' and 'CustomMock'
* AttributeError: module 'httomo' has no attribute 'transform_loader_params'
Failed to import httomo.method_wrappers.datareducer.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.cli.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'cli'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.sweep_runner.param_sweep_store_interfaces.
Possible hints:
* AttributeError: module 'httomo.sweep_runner' has no attribute 'param_sweep_store_interfaces'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.cli_utils.
Possible hints:
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
* AttributeError: module 'httomo' has no attribute 'cli_utils'
Failed to import httomo.base_block.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'base_block'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.method_wrappers.generic.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.block_interfaces.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'block_interfaces'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.loaders.types.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'loaders'
* TypeError: unsupported operand type(s) for |: 'Mock' and 'CustomMock'
Failed to import httomo.data.dataset_store.
Possible hints:
* AttributeError: module 'httomo.data' has no attribute 'dataset_store'
* TypeError: unsupported operand type(s) for |: 'Mock' and 'CustomMock'
Failed to import httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.recon.algorithm.
Possible hints:
* OSError: cufft library not found
* AttributeError: module 'httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.recon' has no attribute 'algorithm'
Failed to import httomo.method_wrappers.rotation.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.data.param_sweep_store.
Possible hints:
* AttributeError: module 'httomo.data' has no attribute 'param_sweep_store'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.runner.sectionizer.
Possible hints:
* AttributeError: module 'httomo.runner' has no attribute 'sectionizer'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.runner.task_runner.
Possible hints:
* TypeError: unsupported operand type(s) for |: 'Mock' and 'CustomMock'
* AttributeError: module 'httomo.runner' has no attribute 'task_runner'
Failed to import httomo.runner.pipeline.
Possible hints:
* AttributeError: module 'httomo.runner' has no attribute 'pipeline'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.runner.block_split.
Possible hints:
* AttributeError: module 'httomo.runner' has no attribute 'block_split'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.method_wrappers.images.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.data.padding.
Possible hints:
* AttributeError: module 'httomo.data' has no attribute 'padding'
* TypeError: unsupported operand type(s) for |: 'Mock' and 'CustomMock'
Failed to import httomo.cufft.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'cufft'
* OSError: cufft library not found
Failed to import httomo.sweep_runner.param_sweep_block.
Possible hints:
* AttributeError: module 'httomo.sweep_runner' has no attribute 'param_sweep_block'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.runner.section.
Possible hints:
* AttributeError: module 'httomo.runner' has no attribute 'section'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.loaders.standard_tomo_loader.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'loaders'
* TypeError: unsupported operand type(s) for |: 'Mock' and 'CustomMock'
Failed to import httomo.method_wrappers.stats_calc.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.loaders.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'loaders'
* TypeError: unsupported operand type(s) for |: 'Mock' and 'CustomMock'
Failed to import httomo.method_wrappers.save_intermediate.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'method_wrappers'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.yaml_checker.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'yaml_checker'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'
Failed to import httomo.sweep_runner.side_output_manager.
Possible hints:
* AttributeError: module 'httomo.sweep_runner' has no attribute 'side_output_manager'
* TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'

The next set of errors is the part that's very long, and here are a few snippets which are either repeated a lot, or are noteworthy:

WARNING: autodoc: failed to import module 'base_block' from module 'httomo'; the following exception was raised:
Traceback (most recent call last):
  File "/dls/science/users/twi18192/conda-envs/docs-httomo-py310-updated/lib/python3.12/site-packages/sphinx/ext/autodoc/importer.py", line 62, in import_module
    return importlib.import_module(modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/dls/science/users/twi18192/conda-envs/docs-httomo-py310-updated/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/dls/science/users/twi18192/httomo/httomo/base_block.py", line 5, in <module>
    from httomo.block_interfaces import BlockData, BlockTransfer, generic_array
  File "/dls/science/users/twi18192/httomo/httomo/block_interfaces.py", line 9, in <module>
    generic_array: TypeAlias = np.ndarray | xp.ndarray
                               ~~~~~~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for |: 'CustomMock' and 'CustomMock'

and:

WARNING: autodoc: failed to import module 'cufft' from module 'httomo'; the following exception was raised:
Traceback (most recent call last):
  File "/dls/science/users/twi18192/conda-envs/docs-httomo-py310-updated/lib/python3.12/site-packages/sphinx/ext/autodoc/importer.py", line 62, in import_module
    return importlib.import_module(modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/dls/science/users/twi18192/conda-envs/docs-httomo-py310-updated/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/dls/science/users/twi18192/httomo/httomo/cufft.py", line 41, in <module>
    raise OSError("cufft library not found")
OSError: cufft library not found
yousefmoazzam commented 1 month ago

Note that running the sphinx-apidoc command (from the sphinx-build.sh script) in isolation produces no warnings/errors:

(/dls/science/users/twi18192/conda-envs/docs-httomo-py310-updated) [twi18192@pc0074 docs (issue-458)]$ SPHINX_APIDOCS_OPTIONS="members,show-inheritance,undoc-members" sphinx-apidoc -feT -t=source/_templates/ -o=s
ource/api ../httomo
Creating file source/api/httomo.rst.
Creating file source/api/httomo.base_block.rst.
Creating file source/api/httomo.block-concrete.rst.
Creating file source/api/httomo.block_interfaces.rst.
Creating file source/api/httomo.cli.rst.
Creating file source/api/httomo.cli_utils.rst.
Creating file source/api/httomo.cufft.rst.
Creating file source/api/httomo.darks_flats.rst.
Creating file source/api/httomo.globals.rst.
Creating file source/api/httomo.logger.rst.
Creating file source/api/httomo.methods.rst.
Creating file source/api/httomo.preview.rst.
Creating file source/api/httomo.transform_layer.rst.
Creating file source/api/httomo.transform_loader_params.rst.
Creating file source/api/httomo.ui_layer.rst.
Creating file source/api/httomo.utils.rst.
Creating file source/api/httomo.yaml_checker.rst.
Creating file source/api/httomo.data.rst.
Creating file source/api/httomo.data.dataset_store.rst.
Creating file source/api/httomo.data.mpiutil.rst.
Creating file source/api/httomo.data.padding.rst.
Creating file source/api/httomo.data.param_sweep_store.rst.
Creating file source/api/httomo.data.hdf.rst.
Creating file source/api/httomo.data.hdf.loaders.rst.
Creating file source/api/httomo.loaders.rst.
Creating file source/api/httomo.loaders.standard_tomo_loader.rst.
Creating file source/api/httomo.loaders.types.rst.
Creating file source/api/httomo.method_wrappers.rst.
Creating file source/api/httomo.method_wrappers.datareducer.rst.
Creating file source/api/httomo.method_wrappers.dezinging.rst.
Creating file source/api/httomo.method_wrappers.generic.rst.
Creating file source/api/httomo.method_wrappers.images.rst.
Creating file source/api/httomo.method_wrappers.reconstruction.rst.
Creating file source/api/httomo.method_wrappers.rotation.rst.
Creating file source/api/httomo.method_wrappers.save_intermediate.rst.
Creating file source/api/httomo.method_wrappers.stats_calc.rst.
Creating file source/api/httomo.methods_database.rst.
Creating file source/api/httomo.methods_database.query.rst.
Creating file source/api/httomo.methods_database.packages.rst.
Creating file source/api/httomo.methods_database.packages.external.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolib.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.misc.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.misc.corr.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.misc.morph.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.misc.rescale.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.prep.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.prep.normalize.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.prep.phase.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.prep.stripe.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.recon.rst.
Creating file source/api/httomo.methods_database.packages.external.httomolibgpu.supporting_funcs.recon.algorithm.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.supporting_funcs.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.supporting_funcs.misc.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.supporting_funcs.misc.corr.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.supporting_funcs.prep.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.supporting_funcs.prep.stripe.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.supporting_funcs.recon.rst.
Creating file source/api/httomo.methods_database.packages.external.tomopy.supporting_funcs.recon.algorithm.rst.
Creating file source/api/httomo.monitors.rst.
Creating file source/api/httomo.monitors.aggregate.rst.
Creating file source/api/httomo.monitors.benchmark.rst.
Creating file source/api/httomo.monitors.summary.rst.
Creating file source/api/httomo.runner.rst.
Creating file source/api/httomo.runner.auxiliary_data.rst.
Creating file source/api/httomo.runner.block_split.rst.
Creating file source/api/httomo.runner.dataset.rst.
Creating file source/api/httomo.runner.dataset_store_backing.rst.
Creating file source/api/httomo.runner.dataset_store_interfaces.rst.
Creating file source/api/httomo.runner.gpu_utils.rst.
Creating file source/api/httomo.runner.loader.rst.
Creating file source/api/httomo.runner.method_wrapper.rst.
Creating file source/api/httomo.runner.methods_repository_interface.rst.
Creating file source/api/httomo.runner.monitoring_interface.rst.
Creating file source/api/httomo.runner.output_ref.rst.
Creating file source/api/httomo.runner.pipeline.rst.
Creating file source/api/httomo.runner.section.rst.
Creating file source/api/httomo.runner.sectionizer.rst.
Creating file source/api/httomo.runner.task_runner.rst.
Creating file source/api/httomo.sweep_runner.rst.
Creating file source/api/httomo.sweep_runner.param_sweep_block-everything.rst.
Creating file source/api/httomo.sweep_runner.param_sweep_block.rst.
Creating file source/api/httomo.sweep_runner.param_sweep_runner.rst.
Creating file source/api/httomo.sweep_runner.param_sweep_store_interfaces.rst.
Creating file source/api/httomo.sweep_runner.param_sweep_yaml_loader.rst.
Creating file source/api/httomo.sweep_runner.side_output_manager.rst.
Creating file source/api/httomo.sweep_runner.stages.rst.

So, it's possibly the sphinx-build command producing all the warnings/errors.

yousefmoazzam commented 1 month ago

Fixed by #494, and the single error now present in CI is documented by #495