Skip to content

Commit

Permalink
Merge branch 'main' into watermark
Browse files Browse the repository at this point in the history
  • Loading branch information
dkazanc authored Sep 9, 2024
2 parents 622451a + 844db56 commit c1e57d7
Show file tree
Hide file tree
Showing 25 changed files with 74 additions and 322 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ jobs:
- name: Build api docs
run: sphinx-apidoc -feT -t=./docs/source/_templates -o ./docs/source/api ./httomo

- name: Generate yaml templates
run: |
python ./scripts/yaml_templates_generator.py -i ./httomo/methods_database/packages/external/tomopy/tomopy_modules.yaml -o ./docs/build/yaml_templates/tomopy
python ./scripts/yaml_unsupported_tomopy_remove.py -t ./docs/build/yaml_templates/tomopy -l ./httomo/methods_database/packages/external/tomopy/tomopy.yaml
python ./scripts/yaml_templates_generator.py -i ./httomo/methods_database/packages/external/httomolib/httomolib_modules.yaml -o ./docs/build/yaml_templates/httomolib
python ./scripts/yaml_templates_generator.py -i ./httomo/methods_database/packages/external/httomolibgpu/httomolibgpu_modules.yaml -o ./docs/build/yaml_templates/httomolibgpu
- name: Generate yml docs
run: python ./docs/source/yaml_doc_generator.py

- name: Build html
run: sphinx-build -a -E -b html ./docs/source/ ./docs/build/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: HTTomo version build
name: version tag pushed

# Run the workflow whenever a tag beginning with `v` is pushed to any branch
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main_conda_package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install httomo
run: |
micromamba activate httomo
micromamba install "httomo/linux-64::httomo * py310_openmpi_regular*" -c conda-forge -c astra-toolbox -c rapidsai -y
micromamba install "httomo/linux-64::httomo * py310_openmpi_regular*" -c conda-forge -y
micromamba list
- name: Generate yaml templates
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run_tests_iris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
micromamba activate httomo
pip install --upgrade --force-reinstall pillow
pip install .[dev]
pip install --upgrade --force-reinstall pillow
micromamba list
- name: Generate yaml templates
Expand Down
2 changes: 1 addition & 1 deletion .scripts/conda_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mkdir ~/conda-bld
conda config --set anaconda_upload no
export CONDA_BLD_PATH=~/conda-bld

$CONDA/bin/conda build . -c conda-forge -c https://conda.anaconda.org/httomo/ -c rapidsai --no-test
$CONDA/bin/conda build . -c conda-forge -c https://conda.anaconda.org/httomo/ --no-test

# upload packages to conda
find $CONDA_BLD_PATH/$OS -name *.tar.bz2 | while read file
Expand Down
5 changes: 2 additions & 3 deletions conda/environment-cpu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: httomo
channels:
- conda-forge
- anaconda
- httomo
dependencies:
- conda-forge::tomopy==1.15
Expand All @@ -13,8 +12,8 @@ dependencies:
- conda-forge::numpy<=1.25
- conda-forge::python
- conda-forge::numexpr>=2.8.4
- anaconda::ipython
- anaconda::loguru
- conda-forge::ipython
- conda-forge::loguru
- conda-forge::graypy
- conda-forge::plumbum
- conda-forge::tqdm
Expand Down
21 changes: 9 additions & 12 deletions conda/environment.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: httomo
channels:
- astra-toolbox
- conda-forge
- httomo
- anaconda
- rapidsai
dependencies:
- astra-toolbox::astra-toolbox
- conda-forge::astra-toolbox
- conda-forge::click>=8.1.3
- conda-forge::cupy<=12.3.0
- conda-forge::numpy<=1.25
- conda-forge::cudatoolkit
- conda-forge::numpy
- conda-forge::cupy=12.3.0
- conda-forge::cudatoolkit>=11.2
- conda-forge::graypy
- conda-forge::h5py=*=*mpi_openmpi*
- conda-forge::hdf5plugin
Expand All @@ -22,9 +19,9 @@ dependencies:
- conda-forge::plumbum
- conda-forge::tqdm
- conda-forge::typing_extensions
- anaconda::ipython
- conda-forge::tomopy==1.15
- httomo::httomolib==2.1
- httomo::httomolibgpu==2.1
- conda-forge::ipython
- conda-forge::tomopy=1.15
- httomo::httomolib=2.1
- httomo::httomolibgpu=2.1
- httomo::tomobar
- rapidsai::cucim

11 changes: 5 additions & 6 deletions conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ requirements:
- h5py=*=*mpi_openmpi*
- httomolib==2.1
- httomolibgpu==2.1
- tomopy==1.15
- loguru
- mpi4py
- numpy<=1.25
Expand All @@ -41,19 +42,18 @@ requirements:
- pyyaml
- setuptools
- setuptools-git-versioning
- tomopy==1.15
- typing_extensions
run:
- astra-toolbox
- click>=8.1.3
- cucim
- cupy<=12.3.0
- cupy=12.3.0
- cudatoolkit
- graypy
- h5py=*=*mpi_openmpi*
- hdf5plugin
- httomolib==2.0
- httomolibgpu==2.0
- httomolib==2.1
- httomolibgpu==2.1
- tomopy==1.15
- ipython
- loguru
- mpi4py
Expand All @@ -68,7 +68,6 @@ requirements:
- python
- plumbum
- tomobar
- tomopy==1.15
- tqdm
- typing_extensions

Expand Down
19 changes: 8 additions & 11 deletions docs/source/backends/list.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
.. _backends_list:

Supported backends
==============================
Supported libraries
===================

HTTomo currently supports several software packages that are used as
backends to perform data processing and reconstruction. The list of
`backends` to perform data processing and reconstruction. The list of
the external packages will be growing in future to meet users' needs.

If the package has a modular structure with an easy access to every
method, for example as `TomoPy <https://tomopy.readthedocs.io>`_
software or `scikit <https://scikit-image.org/>`_ library, then the
method, for example as in the `TomoPy <https://tomopy.readthedocs.io>`_
software or in the `scikit <https://scikit-image.org/>`_ library, then the
integration process is straightforward.
The required YAML template can be generated by using :ref:`utilities_yamlgenerator`,
or manually, and used with HTTomo. More complicated in structure packages would need
an additional wrapping, see for instance the reconstruction methods in
the `HTTomolibgpu <https://github.com/DiamondLightSource/httomolibgpu/blob/main/httomolibgpu/recon/algorithm.py>`_ library.

A YAML template can be generated by using `YAML generator <https://diamondlightsource.github.io/httomo-backends/utilities/yaml_generator.html>`_,
or manually. More complicated in structure packages would need an additional wrapping, see :ref:`info_wrappers`.

Please see the provided list of :ref:`reference_templates`.

Expand Down Expand Up @@ -42,5 +41,3 @@ by Data Analysis Group to work together with the HTTomo software.
HTTomolib library (CPU)
--------------------------
`HTTomolib <https://github.com/DiamondLightSource/httomolib>`_ library is similar to HTTomolibgpu, but contains mostly CPU modules.

.. note:: The HTTomo release usually supports a specific version of the backend package. Please check that the YAML templates are linked to the version advertised in the release.
41 changes: 6 additions & 35 deletions docs/source/backends/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,13 @@
Methods YAML Templates
======================

This section contains YAML templates from :ref:`backends_list`. These are ready-to-use templates can be either copy-pasted or
downloaded in order to build your pipeline.
This section refers to YAML templates from :ref:`backends_list` which are distributed separately through `httomo-backends`.
You will be redirected to the `httomo-backends` page where those templates can be either copy-pasted or
downloaded in order to help you to construct your pipeline.

.. note:: When you click on a module you can find a link to the API of that module. This is where the description of the method and its arguments can be found.
`TomoPy Modules <https://diamondlightsource.github.io/httomo-backends/backends/templates.html#tomopy-modules>`_

`HTTomolibgpu Modules <https://diamondlightsource.github.io/httomo-backends/backends/templates.html#httomolibgpu-modules>`_

TomoPy Modules
---------------
v.1.15
''''''
`HTTomolib Modules <https://diamondlightsource.github.io/httomo-backends/backends/templates.html#httomolib-modules>`_

.. toctree::
:glob:

../api/tomopy*

.. _reference_templates_httomolibgpu:

HTTomolibgpu Modules
--------------------
v.2.1
'''''

.. toctree::
:glob:

../api/httomolibgpu*

.. _reference_templates_httomolib:

HTTomolib Modules
------------------
v.2.0
'''''

.. toctree::
:glob:

../api/httomolib.*
19 changes: 19 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,25 @@
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()


class CustomMock(mock.Mock):
def __repr__(self):
return "<cp.ndarray>"


sys.modules["cupy"] = CustomMock()
sys.modules["numpy"] = CustomMock()
sys.modules["cupyx.scipy.interpolate"] = CustomMock()
sys.modules["cupyx.scipy.ndimage"] = CustomMock()
sys.modules["cupyx.scipy.fft"] = CustomMock()
sys.modules["cupyx.scipy.fftpack"] = CustomMock()
sys.modules["scipy.fftpack"] = CustomMock()
sys.modules["tomobar.methodsDIR_CuPy"] = CustomMock()
sys.modules["tomobar.methodsIR_CuPy "] = CustomMock()
sys.modules["skimage.registration"] = CustomMock()
sys.modules["httomolibgpu.cuda_kernels"] = CustomMock()


# ------------------------------------------------------------------------------

project = "HTTomo"
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developers/how_to_contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ the issues section on `HTTomo's Github page <https://github.com/DiamondLightSour
4. Generate the Yaml template

HTTomo's UI requires :ref:`reference_templates` to execute the created method. One can either construct that YAML template manually or employ
:ref:`utilities_yamlgenerator`.
`YAML generator <https://diamondlightsource.github.io/httomo-backends/utilities/yaml_generator.html>`_.



Expand Down
8 changes: 1 addition & 7 deletions docs/source/doc-conda-requirements.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
name: httomo-docs
channels:
- conda-forge
- defaults
- httomo
- rapidsai
- conda-forge
dependencies:
- python>=3.10
- numpy
- tomopy==1.15
- httomolibgpu==2.1
- httomolib==2.1
- sphinx
- sphinx-book-theme
- nbsphinx
Expand Down
2 changes: 1 addition & 1 deletion docs/source/explanation/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ by importing the method as:
The set of parameter values for that method is given in the *parameters* field.

.. note:: Please note that in the original TomoPy's method, there is also the :code:`arr` parameter. This parameter is not exposed in the template because HTTomo will deal with all I/O aspects behind the scenes by using special wrappers. More on that in :ref:`detailed_about`. :ref:`utilities_yamlgenerator` will automatically generate the ready-to-be-used templates.
.. note:: Please note that in the original TomoPy's method, there is also the :code:`arr` parameter. This parameter is not exposed in the template because HTTomo will deal with all I/O aspects behind the scenes by using special wrappers. More on that in :ref:`detailed_about`. `YAML generator <https://diamondlightsource.github.io/httomo-backends/utilities/yaml_generator.html>`_ will automatically generate the ready-to-be-used templates.

Please see the list of all supported :ref:`reference_templates`.
4 changes: 2 additions & 2 deletions docs/source/howto/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This installation is preferable as it should take care all of dependencies inclu
.. code-block:: console
$ conda env create --name httomo # create a fresh conda environment
$ conda install "httomo/linux-64::httomo * py310_openmpi_regular*" -c conda-forge -c astra-toolbox -c rapidsai
$ conda install "httomo/linux-64::httomo * py310_openmpi_regular*" -c conda-forge
Install as a Python module
===========================
Expand All @@ -35,4 +35,4 @@ Build HTTomo as a conda Python package
======================================================
.. code-block:: console
$ conda build conda/recipe/ -c conda-forge -c https://conda.anaconda.org/httomo/ -c rapidsai --no-test
$ conda build conda/recipe/ -c conda-forge -c https://conda.anaconda.org/httomo/ --no-test
2 changes: 1 addition & 1 deletion docs/source/howto/process_lists/side_outputs/side_out.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ information of :ref:`centering` is stored in the reference
There could be various configurations when this reference is required from other methods as well. We present more verbose :ref:`side_output_example` below.

.. note:: Side outputs and references to them are generated automatically with the
:ref:`utilities_yamlgenerator`. Usually there is no need to modify them when
`YAML generator <https://diamondlightsource.github.io/httomo-backends/utilities/yaml_generator.html>`_. Usually there is no need to modify them when
editing a process list.

.. _side_output_example:
Expand Down
3 changes: 1 addition & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
.. _backends_content:

.. toctree::
:caption: Templates for backends
:caption: Data processing
:maxdepth: 2

backends/list
Expand All @@ -58,7 +58,6 @@
:maxdepth: 2

utilities/yaml_checker
utilities/yaml_generator

.. _developers_content:

Expand Down
33 changes: 0 additions & 33 deletions docs/source/utilities/yaml_generator.rst

This file was deleted.

Loading

0 comments on commit c1e57d7

Please sign in to comment.