Skip to content

Commit

Permalink
Merge pull request #377 from DiamondLightSource/cpu_only
Browse files Browse the repository at this point in the history
fixes cpu-only environment and also auxilary data condition for cupy
  • Loading branch information
dkazanc authored Jul 3, 2024
2 parents 8aa2064 + 46c005d commit c2bc45a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
18 changes: 11 additions & 7 deletions conda/environment-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ channels:
- anaconda
- httomo
dependencies:
- conda-forge::click
- conda-forge::tomopy==1.15
- httomo::httomolib==2.0
- conda-forge::click>=8.1.3
- conda-forge::mpi4py>=3.1
- conda-forge::h5py==3.8.0[build=*openmpi*]
- conda-forge::h5py=*=*mpi_openmpi*
- conda-forge::pyyaml
- conda-forge::numpy<1.24
- conda-forge::python
- conda-forge::tomopy
- conda-forge::numpy<=1.25
- conda-forge::python
- conda-forge::numexpr>=2.8.4
- anaconda::ipython
- anaconda::loguru
- httomo::httomolib
- anaconda::loguru
- conda-forge::graypy
- conda-forge::plumbum
- conda-forge::tqdm
- conda-forge::typing_extensions
5 changes: 3 additions & 2 deletions docs/source/howto/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ Install as a Python module
===========================

If installation above for some reason is not working for you, then the best way to install HTTomo is to create conda environment first and then
`pip install` HTTomo into it. You will need to `git clone` HTTomo repository to your disk first.
`pip install` HTTomo into it. You will need to `git clone` HTTomo repository to your disk first. Use `environment.yml` file to install
the GPU-supported HTTomo. For CPU-only version, please use `environment-cpu.yml` instead.

.. code-block:: console
$ git clone [email protected]:DiamondLightSource/HTTomo.git # clone the repo
$ conda env create --name httomo --file conda/environment.yml # install dependencies
$ conda env create --name httomo --file conda/environment.yml # install dependencies for GPU version
$ conda activate httomo # activate environment
$ pip install . # Install the module
Expand Down
3 changes: 2 additions & 1 deletion httomo/runner/auxiliary_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def _get_field(self, field: str, gpu=False) -> generic_array:
if gpu:
array = xp.asarray(array)
else:
array = xp.asnumpy(array)
if xp.__name__ == 'cupy':
array = xp.asnumpy(array)

setattr(self, f"_{field}", array)

Expand Down

0 comments on commit c2bc45a

Please sign in to comment.