diff --git a/install/dependencies/conda-recipes/astra-toolbox/build.sh b/install/dependencies/conda-recipes/astra-toolbox/build.sh new file mode 100644 index 000000000..417b65cdb --- /dev/null +++ b/install/dependencies/conda-recipes/astra-toolbox/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +nvcc=`command -v nvcc` +cuda=${nvcc%/bin/nvcc} + +cd $SRC_DIR/build/linux +chmod +x autogen.sh +./autogen.sh + +if [ "$cuda" ]; then + ./configure --with-cuda=$cuda \ + --with-python \ + --with-install-type=module +else + echo "cuda has not been found will configure without it." + ./configure --with-python \ + --with-install-type=module +fi + +make -j 4 +make install diff --git a/install/dependencies/conda-recipes/astra-toolbox/meta.yaml b/install/dependencies/conda-recipes/astra-toolbox/meta.yaml new file mode 100644 index 000000000..b0c16d074 --- /dev/null +++ b/install/dependencies/conda-recipes/astra-toolbox/meta.yaml @@ -0,0 +1,34 @@ +package: + name: astra-toolbox + version: '1.9.9dev' + +source: + git_url: https://github.com/astra-toolbox/astra-toolbox.git + git_tag: master + +build: + number: 0 + script_env: + - CC # [linux] + +requirements: + build: + - python + - numpy + - cython >=0.13 + - nomkl # [not win] + - scipy + - cudatoolkit >=10.1 + - six + +run: + - python + - numpy + - scipy + - six + - libastra ==1.9.9dev + +about: + home: http://www.astra-toolbox.com + license: GPLv3 + summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' diff --git a/install/dependencies/conda-recipes/geodist/conda_build_config.yaml b/install/dependencies/conda-recipes/geodist/conda_build_config.yaml new file mode 100644 index 000000000..16cc975b8 --- /dev/null +++ b/install/dependencies/conda-recipes/geodist/conda_build_config.yaml @@ -0,0 +1,2 @@ +python: + - 3.9 diff --git a/install/dependencies/conda-recipes/geodist/meta.yaml b/install/dependencies/conda-recipes/geodist/meta.yaml new file mode 100644 index 000000000..6aa8fb7bb --- /dev/null +++ b/install/dependencies/conda-recipes/geodist/meta.yaml @@ -0,0 +1,36 @@ +{% set name = 'geodistk' %} +{% set version = '0.1.6' %} + +package: + name: {{ name | lower }} + version: {{ version }} + + +source: + git_url: https://github.com/taigw/GeodisTK.git + git_tag: master + +requirements: + build: + - python {{ python }} + - numpy + run: + - python {{ python }} + - numpy + +build: + number: 0 + script: + - {{ PYTHON }} -m pip install . + +test: + imports: + - GeodisTK + +app: + summary: "Geodesic distance transform of 2d/3d images" + +about: + home: https://github.com/taigw/GeodisTK + license: MIT + license_file: LICENSE diff --git a/install/savu_hpc/conda-recipes/h5py/build.sh b/install/dependencies/conda-recipes/h5py/build.sh similarity index 100% rename from install/savu_hpc/conda-recipes/h5py/build.sh rename to install/dependencies/conda-recipes/h5py/build.sh diff --git a/install/savu_hpc/conda-recipes/h5py/meta.yaml b/install/dependencies/conda-recipes/h5py/meta.yaml similarity index 100% rename from install/savu_hpc/conda-recipes/h5py/meta.yaml rename to install/dependencies/conda-recipes/h5py/meta.yaml diff --git a/install/savu_hpc/conda-recipes/hdf5/build.sh b/install/dependencies/conda-recipes/hdf5/build.sh similarity index 100% rename from install/savu_hpc/conda-recipes/hdf5/build.sh rename to install/dependencies/conda-recipes/hdf5/build.sh diff --git a/install/savu_hpc/conda-recipes/hdf5/meta.yaml b/install/dependencies/conda-recipes/hdf5/meta.yaml similarity index 100% rename from install/savu_hpc/conda-recipes/hdf5/meta.yaml rename to install/dependencies/conda-recipes/hdf5/meta.yaml diff --git a/install/savu_hpc/conda-recipes/hdf5/setup_hdf5_build.sh b/install/dependencies/conda-recipes/hdf5/setup_hdf5_build.sh similarity index 100% rename from install/savu_hpc/conda-recipes/hdf5/setup_hdf5_build.sh rename to install/dependencies/conda-recipes/hdf5/setup_hdf5_build.sh diff --git a/install/savu_hpc/conda-recipes/installer.sh b/install/dependencies/conda-recipes/installer.sh similarity index 100% rename from install/savu_hpc/conda-recipes/installer.sh rename to install/dependencies/conda-recipes/installer.sh diff --git a/install/dependencies/conda-recipes/morphsnakes/conda_build_config.yaml b/install/dependencies/conda-recipes/morphsnakes/conda_build_config.yaml new file mode 100644 index 000000000..16cc975b8 --- /dev/null +++ b/install/dependencies/conda-recipes/morphsnakes/conda_build_config.yaml @@ -0,0 +1,2 @@ +python: + - 3.9 diff --git a/install/dependencies/conda-recipes/morphsnakes/meta.yaml b/install/dependencies/conda-recipes/morphsnakes/meta.yaml new file mode 100644 index 000000000..95ea6996b --- /dev/null +++ b/install/dependencies/conda-recipes/morphsnakes/meta.yaml @@ -0,0 +1,37 @@ +{% set name = 'morphsnakes' %} +{% set version = '1.0' %} + +package: + name: {{ name | lower }} + version: {{ version }} + +source: + git_url: https://github.com/pmneila/morphsnakes.git + git_tag: master + +requirements: + build: + - python {{ python }} + - numpy + - scipy>=0.17.0 + run: + - python {{ python }} + - numpy + - scipy>=0.17.0 + +build: + number: 0 + script: + - {{ PYTHON }} -m pip install . + +test: + imports: + - morphsnakes + +app: + summary: "Morphological Snakes for image segmentation. morphsnakes supports 2D images and 3D volumes" + +about: + home: https://github.com/pmneila/morphsnakes + license: MIT + license_file: LICENSE diff --git a/install/savu_hpc/conda-recipes/mpi4py/build.sh b/install/dependencies/conda-recipes/mpi4py/build.sh similarity index 100% rename from install/savu_hpc/conda-recipes/mpi4py/build.sh rename to install/dependencies/conda-recipes/mpi4py/build.sh diff --git a/install/savu_hpc/conda-recipes/mpi4py/helloworld.py b/install/dependencies/conda-recipes/mpi4py/helloworld.py similarity index 100% rename from install/savu_hpc/conda-recipes/mpi4py/helloworld.py rename to install/dependencies/conda-recipes/mpi4py/helloworld.py diff --git a/install/savu_hpc/conda-recipes/mpi4py/meta.yaml b/install/dependencies/conda-recipes/mpi4py/meta.yaml similarity index 100% rename from install/savu_hpc/conda-recipes/mpi4py/meta.yaml rename to install/dependencies/conda-recipes/mpi4py/meta.yaml diff --git a/install/savu_hpc/conda-recipes/mpi4py/mpiexec.sh b/install/dependencies/conda-recipes/mpi4py/mpiexec.sh similarity index 100% rename from install/savu_hpc/conda-recipes/mpi4py/mpiexec.sh rename to install/dependencies/conda-recipes/mpi4py/mpiexec.sh diff --git a/install/savu_hpc/conda-recipes/mpi4py/run_test.sh b/install/dependencies/conda-recipes/mpi4py/run_test.sh similarity index 100% rename from install/savu_hpc/conda-recipes/mpi4py/run_test.sh rename to install/dependencies/conda-recipes/mpi4py/run_test.sh diff --git a/install/savu_hpc/conda-recipes/pmacparser/recipe/build.sh b/install/dependencies/conda-recipes/pmacparser/build.sh similarity index 100% rename from install/savu_hpc/conda-recipes/pmacparser/recipe/build.sh rename to install/dependencies/conda-recipes/pmacparser/build.sh diff --git a/install/savu_hpc/conda-recipes/pmacparser/recipe/meta.yaml b/install/dependencies/conda-recipes/pmacparser/meta.yaml similarity index 100% rename from install/savu_hpc/conda-recipes/pmacparser/recipe/meta.yaml rename to install/dependencies/conda-recipes/pmacparser/meta.yaml diff --git a/install/dependencies/conda-recipes/pypwt/conda-recipe/build.sh b/install/dependencies/conda-recipes/pypwt/conda-recipe/build.sh new file mode 100644 index 000000000..d3c2cb4ea --- /dev/null +++ b/install/dependencies/conda-recipes/pypwt/conda-recipe/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +python setup.py install diff --git a/install/dependencies/conda-recipes/pypwt/conda-recipe/meta.yaml b/install/dependencies/conda-recipes/pypwt/conda-recipe/meta.yaml new file mode 100644 index 000000000..bb78d25fb --- /dev/null +++ b/install/dependencies/conda-recipes/pypwt/conda-recipe/meta.yaml @@ -0,0 +1,31 @@ +{% set version = "0.9" %} + +package: + name: pypwt + version: {{ version }}_{{ environ['CUDA_VERSION'] }} + +source: + url: https://github.com/dkazanc/pypwt/archive/{{ version }}.tar.gz + +requirements: + build: + - python + - pip + - numpy + - setuptools + - cython >=0.13 + - cudatoolkit={{ environ['CUDA_VERSION'] }} + + run: + - python + - numpy + - setuptools + +build: + preserve_egg_dir: False + number: 0 + +about: + home: https://github.com/pierrepaleo/pypwt + license: Apache V2 and GPL V3 + summary: 'pypwt is a python module for parallel Discrete Wavelet Transform. This is a wrapper of PDWT.' diff --git a/install/savu_hpc/conda-recipes/tomophantom/build.sh b/install/savu_hpc/conda-recipes/tomophantom/build.sh deleted file mode 100644 index 774f342f7..000000000 --- a/install/savu_hpc/conda-recipes/tomophantom/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -mkdir -p ${SRC_DIR}/tomophantom -cd tomophantom - -#issue cmake to create setup.py -cmake -G "Unix Makefiles" ../ -DBUILD_PYTHON_WRAPPER=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX -make install - diff --git a/install/savu_hpc/conda-recipes/tomophantom/meta.yaml b/install/savu_hpc/conda-recipes/tomophantom/meta.yaml deleted file mode 100644 index e85796d70..000000000 --- a/install/savu_hpc/conda-recipes/tomophantom/meta.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{% set CIL_VERSION = "1.4.7" %} - -package: - name: tomophantom - version: {{ CIL_VERSION }} - -source: - url: https://github.com/dkazanc/TomoPhantom/archive/v{{ CIL_VERSION }}.tar.gz - - -build: - preserve_egg_dir: False - number: 0 - script_env: - - CIL_VERSION={{ CIL_VERSION }} - -requirements: - build: - - python - - numpy - - setuptools - - cython - - cmake - - blas=*=openblas # [not win] - - - run: - - {{ pin_compatible('numpy', max_pin='x.x') }} - - python - - numpy - - libgcc-ng # [unix] - -about: - home: https://github.com/dkazanc/TomoPhantom - license: Apache 2.0 license - summary: 'Tomography Phantom Data generator' diff --git a/install/savu_lite37/condabuild/meta.yaml b/install/savu_lite37/condabuild/meta.yaml deleted file mode 100644 index 59198750c..000000000 --- a/install/savu_lite37/condabuild/meta.yaml +++ /dev/null @@ -1,93 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu-lite - version: {{ environ['VERSION'] }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -build: - preserve_egg_dir: True - number: 0 - script: python setup.py install - -requirements: - host: - - python - - pip - - wheel - - run: - - python - - ipython - - numpy - - tomopy 1.9.1 py37h8342161_101 - - hdf5 1.10.5 - - openmpi 4.0.2 hb1b8bf9_1 - - h5py=*=mpi_openmpi* - - mpi4py 3.0.3 py37hd955b32_1 - - scipy 1.5.2 py37h0b6359f_0 - - pandas 1.1.3 py37h3340039_0 - - pywavelets 1.1.1 py37h03ebfcd_1 - - scikit-image 0.17.2 py37h0da4684_1 - - scikit-learn 0.23.1 py37h8a51577_0 - - geodistk 0.1.6 py37hdeaff10_0 - - morphsnakes 1.0 py37hdeaff10_0 - - tomobar 2021.03 py37hdeaff10_0 - - tomophantom 2021.01 np115py37_0 - - larix 2021.03 py37hdeaff10_0 - - ccpi-reconstruction 20.09 np115py37h3be76a2_0 - - ccpi-regulariser 2021.03 np115py37_0 - - astra-toolbox 1.9.9.dev4 py37hb48bd9c_0 - - pyfai 0.19.0 py37hb3f55d8_0 - - pymca 5.5.5 py37h03ebfcd_1 - - pyfftw 0.12.0 py37hc3ef4f8_1 - - xraylib 4.0.0 py37h539c4ae_2 - - peakutils 1.3.3 py_0 - - mrcfile 1.2.0 pyhd3deb0d_0 - - tifffile 2020.6.3 py_0 - - fabio 0.10.2 py37h03ebfcd_0 - - colorama 0.4.4 pyh9f0ad1d_0 - - jinja2 2.11.2 pyh9f0ad1d_0 - - pytest 6.2.1 py37h89c1867_0 - - pytest-xdist 2.2.1 pyhd3eb1b0_0 - - setuptools 49.6.0 py37he5f6b98_2 - - mock 4.0.3 py37h89c1867_0 - - spyder 4.2.0 py37h89c1867_0 - - pip 20.3.3 pyhd8ed1ab_0 - - pmacparser 4.0 py37hdeaff10_0 - - linecache2 - - traceback2 - - pynvml - - yamllint - -test: - imports: - - colorama - - h5py - - mpi4py - - numpy - - scipy - - pyfftw - - linecache2 - - traceback2 - - savu - - yaml - - commands: - - savu --version - - savu_config -h - - savu_quick_tests - -about: - home: https://github.com/DiamondLightSource/Savu - license: Apache V2 and GPL V3 - license_family: GPL3 - doc_url: https://savu-lite.readthedocs.io/en/latest/ - dev_url: https://github.com/DiamondLightSource/Savu/ - summary: "Savu-lite - Minimal version of Savu tomography and processing pipeline suitable for processing data on a PC" - -extra: - recipe-maintainers: - - DaniilKazantsev diff --git a/install/savu_lite39/condabuild/meta.yaml b/install/savu_lite39/condabuild/meta.yaml new file mode 100644 index 000000000..461545c1e --- /dev/null +++ b/install/savu_lite39/condabuild/meta.yaml @@ -0,0 +1,99 @@ +{% set repo = "py39" %} + +package: + name: savu-lite + version: {{ environ['VERSION'] }} + +source: + url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz + +build: + preserve_egg_dir: True + number: 0 + script: python setup.py install + +requirements: + host: + - python + - pip + - wheel + + run: + - python + - ipython + - cudatoolkit >=10.1 + - numpy + - tomopy + - astra-toolbox + - ccpi-regulariser + - ccpi-reconstruction + - morphsnakes + - geodistk + - pmacparser + - tomophantom + - tomobar + - larix + - hdf5 + - openmpi + - h5py >3.0 + - mpi4py + - scipy + - pandas + - pywavelets + - pypwt + - pystackreg + - pytorch + - fastai + - scikit-image + - scikit-learn + - colorama + - jinja2 + - pytest + - pytest-xdist + - mock + - spyder + - setuptools + - pip + - pynvml + - yamllint + - linecache2 + - traceback2 + - pyfftw + - xraylib + - peakutils + - tifffile + - pyfai + - pymca + - mrcfile + - fabio + +test: + imports: + - astra + - colorama + - h5py + - mpi4py + - numpy + - scipy + - pyfftw + - linecache2 + - traceback2 + - savu + - yaml + + commands: + - savu --version + - savu_config -h + - savu_quick_tests + +about: + home: https://github.com/DiamondLightSource/Savu + license: Apache V2 and GPL V3 + license_family: GPL3 + doc_url: https://savu-lite.readthedocs.io/en/latest/ + dev_url: https://github.com/DiamondLightSource/Savu/ + summary: "Savu-lite - Minimal version of Savu tomography and processing pipeline suitable for processing data on a PC" + +extra: + recipe-maintainers: + - DaniilKazantsev diff --git a/install/savu_lite39/condabuild/savulite_installer.sh b/install/savu_lite39/condabuild/savulite_installer.sh new file mode 100755 index 000000000..fe093e648 --- /dev/null +++ b/install/savu_lite39/condabuild/savulite_installer.sh @@ -0,0 +1,6 @@ +#!/bin/bash +export VERSION=4.0_$(date +%Y.%m) +conda install --yes conda-build anaconda-client setuptools conda-verify +#conda build . -c https://conda.anaconda.org/conda-forge/ -c https://conda.anaconda.org/astra-toolbox/label/dev/ -c https://conda.anaconda.org/savu-dep/ -c https://conda.anaconda.org/ccpi/ --numpy 1.15 --python 3.7 --override-channels +conda build . -c defaults -c conda-forge -c savu-dep -c ccpi -c fastai --override-channels +#conda build . --numpy 1.15 --python 3.7 -c astra-toolbox/label/dev/ diff --git a/savu/data/data_structures/plugin_data.py b/savu/data/data_structures/plugin_data.py index 5e711c6f1..ac25f5a22 100644 --- a/savu/data/data_structures/plugin_data.py +++ b/savu/data/data_structures/plugin_data.py @@ -27,7 +27,6 @@ import h5py import logging import numpy as np -from fractions import gcd from savu.data.meta_data import MetaData from savu.data.data_structures.data_add_ons import Padding @@ -345,7 +344,7 @@ def _get_max_frames_process(self): frame_chunk = self.meta_data.get("max_frames_process") chunk = self.data_obj.get_preview().get_starts_stops_steps( key='chunks')[self.get_slice_directions()[0]] - self.meta_data.set('max_frames_process', gcd(frame_chunk, chunk)) + self.meta_data.set('max_frames_process', math.gcd(frame_chunk, chunk)) return self.meta_data.get("max_frames_process") def _get_max_frames_transfer(self): @@ -358,17 +357,17 @@ def _set_no_squeeze(self): def _get_no_squeeze(self): return self.no_squeeze - + def _set_rank_inc(self, n): """ Increase the rank of the array passed to the plugin by n. - + :param int n: Rank increment. """ self._increase_rank = n - + def _get_rank_inc(self): """ Return the increased rank value - + :returns: Rank increment :rtype: int """