From 998c25a2a80408d116bbf90df0e14537e27f187b Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 6 Feb 2023 15:03:17 +0000 Subject: [PATCH 01/27] rempove py36 np1.15, GHA to test py39 np122 --- .github/workflows/conda_and_docs_build.yml | 2 ++ CHANGELOG.md | 3 +++ recipe/conda_build_config.yaml | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda_and_docs_build.yml b/.github/workflows/conda_and_docs_build.yml index a8267a2b29..1907c0dc7d 100644 --- a/.github/workflows/conda_and_docs_build.yml +++ b/.github/workflows/conda_and_docs_build.yml @@ -24,6 +24,8 @@ jobs: channels: '-c conda-forge -c intel -c astra-toolbox/label/dev -c cvxgrp -c ccpi --override-channels' convert_win: false convert_osx: false + test_pyver: 3.9 + test_npver: 1.22 - name: Upload artifact of the conda package. uses: actions/upload-artifact@v3.1.1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 911e8d4346..9c0d82d9c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ * Next + - Dropped support for Python 3.6 and NumPy 1.15 + - Jenkins PR tests on Python 3.8 and NumPy 1.20 - added yml file to create test environment - LeastSquares fixed docstring and unified gradient code when out is passed or not. - Add compression to 8bit and 16bit to TIFFWriter @@ -11,6 +13,7 @@ - Significant speed increase available via the C++ backend - Returned geometry is correctly offset where binning/cropping moves the origin - Github Actions: + - update test python and numpy versions to 3.9 and 1.22 - Update conda build action to v2.0.0 - Fixes actions to run on ubuntu-20.04 - Update version of upload_artifact github action to version 3.1.1 diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 5191a918cd..5a2373e1d9 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,6 +1,5 @@ #creates pairs of versions using zip_keys, lists must be the same length python: - - 3.6 # [ linux ] - 3.8 - 3.8 - 3.8 @@ -10,7 +9,6 @@ python: - 3.10 - 3.10 numpy: - - 1.15 # [ linux ] - 1.20 - 1.21 - 1.22 From 250cb03d1186aa1ace438d02eb4c3b7d0236590a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 2 Feb 2026 11:12:06 +0000 Subject: [PATCH 02/27] update readme --- README.md | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 9a9149b869..e30c48efa3 100644 --- a/README.md +++ b/README.md @@ -138,30 +138,17 @@ git submodule update --init --recursive #### Install Dependencies -To create a conda environment with all the dependencies for building CIL run the following shell script: +We suggest creating a conda environment with all the dependencies for building CIL running the following shell script depending on operating system: -```sh -bash ./scripts/create_local_env_for_cil_development.sh -``` - -Or with the CIL build and test dependencies: - -```sh -bash ./scripts/create_local_env_for_cil_development.sh -t -``` - -And then install CIL in to this environment using `pip`. +| OS | Command | Status | +|----|----|----| +| Linux | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`| Tested | +| Windows | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`| Tested | +| MacOS (ARM) | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development_osx.yml`| Experimental | -Alternatively, one can use the `scripts/requirements-test.yml` to create a conda environment with all the -appropriate dependencies, using the following command: +> [!NOTE] +> Currently only Linux and Windows are tested and supported. The support on MacOS (ARM) is experimental and certain features are not available/working, such as FFT filtering for FDK. -```sh -conda env create -f ./scripts/requirements-test.yml -``` -or, on windows: -```sh -conda env create -f ./scripts/requirements-test-windows.yml -``` #### Build CIL @@ -170,6 +157,8 @@ A C++ compiler is required to build the source code. Let's suppose that the user ```sh pip install --no-deps . ``` +> [!NOTE] +> You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. If not installing inside a conda environment, then the user might need to set the locations of optional libraries: @@ -188,7 +177,7 @@ docker build . -t ghcr.io/tomographicimaging/cil ### Testing -One installed, CIL functionality can be tested using the following command: +Once installed, CIL functionality can be tested using the following command: ```sh export TESTS_FORCE_GPU=1 # optional, makes GPU test failures noisy From 42af67907e35c1ab1b2171465179f3ffd290fdac Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 2 Feb 2026 12:09:23 +0000 Subject: [PATCH 03/27] updated clone and build command data is not installed by the pip command so it is not useful to clone the repo recursively --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e30c48efa3..db61003235 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,7 @@ Jupyter Notebooks usage examples without any local installation are provided in In case of development it is useful to be able to build the software directly. You should clone this repository as ```sh -git clone --recurse-submodule git@github.com:TomographicImaging/CIL -``` - -The use of `--recurse-submodule` is necessary if the user wants the examples data to be fetched (they are needed by the unit tests). We have moved such data, previously hosted in this repo at `Wrappers/Python/data` to the [CIL-data](https://github.com/TomographicImaging/CIL-Data) repository and linked it to this one as submodule. If the data is not available it can be fetched in an already cloned repository as - -```sh -git submodule update --init --recursive +git clone git@github.com:TomographicImaging/CIL ``` ### Building with `pip` @@ -154,9 +148,12 @@ We suggest creating a conda environment with all the dependencies for building C A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following commands should work: -```sh -pip install --no-deps . -``` + +| OS | Build Command | +|----|----| +| Linux | `pip install --no-deps . -Ccmake.define.IPP_ROOT=$CONDA_PREFIX`| +| Windows | `pip install --no-deps . -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%| + > [!NOTE] > You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. From 3c1b6425e56c855e37ed52b691ebfeaff0adf684 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 2 Feb 2026 12:30:04 +0000 Subject: [PATCH 04/27] update pip command to find IPP --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db61003235..f3452008e3 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ A C++ compiler is required to build the source code. Let's suppose that the user | OS | Build Command | |----|----| | Linux | `pip install --no-deps . -Ccmake.define.IPP_ROOT=$CONDA_PREFIX`| -| Windows | `pip install --no-deps . -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%| +| Windows | `pip install --no-deps . -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%`| > [!NOTE] > You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. From 482a640cb4511ccc672d2d54d8fd7ca2f871eb44 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 2 Feb 2026 13:44:41 +0000 Subject: [PATCH 05/27] fix recipe to find IPP --- recipe/bld.bat | 2 +- recipe/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 97fb90517d..06b65a1dc5 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -4,5 +4,5 @@ set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL=%PKG_VERSION% if not "%GIT_DESCRIBE_NUMBER%"=="0" ( set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL=%PKG_VERSION%.dev%GIT_DESCRIBE_NUMBER%+%GIT_DESCRIBE_HASH% ) -pip install . --no-deps +pip install . --no-deps -Ccmake.define.IPP_ROOT=%CONDA_PREFIX% if errorlevel 1 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh index 872bff219b..1266a3cd7c 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -6,7 +6,7 @@ if test $(python -c "from __future__ import print_function; import platform; pri echo "Darwin" extra_args="$extra_args -DOPENMP_LIBRARIES=${CONDA_PREFIX}/lib -DOPENMP_INCLUDES=${CONDA_PREFIX}/include" else - echo "something else" + extra_args="$extra_args -DIPP_ROOT=${CONDA_PREFIX}" fi export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL="${PKG_VERSION}" From d37a15701e01713cb7a80cb12b8317f2b1aafdfd Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 2 Feb 2026 16:15:58 +0000 Subject: [PATCH 06/27] update pip command --- recipe/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index 1266a3cd7c..f81c5a9751 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -6,11 +6,11 @@ if test $(python -c "from __future__ import print_function; import platform; pri echo "Darwin" extra_args="$extra_args -DOPENMP_LIBRARIES=${CONDA_PREFIX}/lib -DOPENMP_INCLUDES=${CONDA_PREFIX}/include" else - extra_args="$extra_args -DIPP_ROOT=${CONDA_PREFIX}" + echo "Not Darwin" fi export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL="${PKG_VERSION}" if test "${GIT_DESCRIBE_NUMBER}" != "0"; then export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL="${PKG_VERSION}.dev${GIT_DESCRIBE_NUMBER}+${GIT_DESCRIBE_HASH}" fi -pip install . --no-deps -Ccmake.args="${extra_args}" +pip install . --no-deps -Ccmake.args="${extra_args}" -Ccmake.define.IPP_ROOT=${CONDA_PREFIX} From 758f315748655e7006d2ac44a801c8bcd88a1dcd Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 6 Feb 2026 09:35:55 +0000 Subject: [PATCH 07/27] add search CMake search path for WIN32 IPP --- src/Core/cmake/FindIPP.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Core/cmake/FindIPP.cmake b/src/Core/cmake/FindIPP.cmake index b5c402d202..b0c289c6ee 100644 --- a/src/Core/cmake/FindIPP.cmake +++ b/src/Core/cmake/FindIPP.cmake @@ -10,16 +10,18 @@ elseif(NOT WIN32) set(IPP_PRE "lib") set(IPP_POST ".so") endif() -find_library(IPP_CORE ${IPP_PRE}ippcore${IPP_POST} PATHS ${IPP_ROOT_DIR}) -find_library(IPP_S ${IPP_PRE}ipps${IPP_POST} PATHS ${IPP_ROOT_DIR}) -find_library(IPP_VM ${IPP_PRE}ippvm${IPP_POST} PATHS ${IPP_ROOT_DIR}) -find_library(IPP_I ${IPP_PRE}ippi${IPP_POST} PATHS ${IPP_ROOT_DIR}) +find_library(IPP_CORE ${IPP_PRE}ippcore${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) +find_library(IPP_S ${IPP_PRE}ipps${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) +find_library(IPP_VM ${IPP_PRE}ippvm${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) +find_library(IPP_I ${IPP_PRE}ippi${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) if(IPP_INCLUDE_DIR AND IPP_CORE AND IPP_S AND IPP_VM AND IPP_I) message(STATUS "IPP found in: ${IPP_ROOT_DIR}") set(IPP_FOUND TRUE) set(IPP_INCLUDE_DIRS "${IPP_INCLUDE_DIR}") set(IPP_LIBRARIES "${IPP_CORE};${IPP_S};${IPP_VM};${IPP_I}") + message(STATUS "IPP libraries: ${IPP_LIBRARIES}") + message(STATUS "IPP include dirs: ${IPP_INCLUDE_DIRS}") else() message(STATUS "IPP not found") endif() From 6a098d59bef9b93b7bbd3435ceff5045658f3388 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 6 Feb 2026 10:28:54 +0000 Subject: [PATCH 08/27] added instructions on developer guide --- docs/source/developer_guide.rst | 85 +++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 0c65dae4d9..b9a70356b5 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -16,6 +16,9 @@ Developers' Guide ***************** + + + CIL is an Object Orientated software. It has evolved during the years and it currently does not fully adhere to the following conventions. New additions must comply with the following. @@ -109,6 +112,88 @@ Rendered .. automethod:: cil.recon.FBP.FBP.run +Building CIL from source code +----------------------------- + +Getting the code +^^^^^^^^^^^^^^^^ + +In case of local development and testing it is useful to be able to build the software directly. +You should first clone this repository as + +.. code:: sh + + git clone git@github.com:TomographicImaging/CIL + +Building with ``pip`` +^^^^^^^^^^^^^^^^^^^^^ + +Install Dependencies +"""""""""""""""""" + +We suggest creating a conda environment with all the dependencies for building CIL running the following shell script depending on operating system: + +.. list-table:: + :header-rows: 1 + :widths: 20 65 15 + + * - OS + - Command + - Status + * - Linux + - ``conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`` + - Tested + * - Windows + - ``conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`` + - Tested + * - MacOS (ARM) + - ``conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development_osx.yml`` + - Experimental + +.. note:: + Currently only Linux and Windows are tested and supported. The support on MacOS (ARM) is experimental and certain features are not available and not working, such as FFT filtering for FDK. + +Build CIL +"""""""" + +A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following commands should work: + +.. list-table:: + :header-rows: 1 + :widths: 20 80 + + * - OS + - Build Command + * - Linux + - ``pip install --no-deps . -Ccmake.define.IPP_ROOT=$CONDA_PREFIX`` + * - Windows + - ``pip install --no-deps . -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%`` + +.. note:: + You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. + + + +If not installing inside a conda environment, then the user might need to set the locations of optional libraries: + +.. code:: sh + + pip install . -Ccmake.define.IPP_ROOT="" -Ccmake.define.OpenMP_ROOT="" + +Notes for Windows users +"""""""""""""""" + +Install Visual Studio Community (or higher) and select the **Desktop development with C++** workload. + +If you are developing on Windows with conda, you need to have access to both the Visual Studio compiler and the conda environment. + +You can achieve this in two ways: +1. by opening a "Developer Command Prompt for Visual Studio" and activating the conda environment from there. This requires you +to know the path to the `conda.bat` file, which is typically located in the `condabin` subdirectory of your conda installation. +Once located you need to run `\conda.bat activate ` to activate the conda environment, and then you can run the build command from there. +2. by opening the conda prompt and running the `vcvarsall.bat x64` file from the Visual Studio installation (with `x64` argument). +This requires you to know the path to the `vcvarsall.bat` file, +which is typically located in the `VC/Auxiliary/Build` subdirectory of your Visual Studio installation. Building documentation locally ------------------------------ From e597d5360b848f599e86c9f0c88dd3c46e2aa5ff Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 6 Feb 2026 16:33:31 +0000 Subject: [PATCH 09/27] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81227615c7..b921963434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - improve `tqdm` notebook support (#2241) - Documentation: - Render the user showcase notebooks in the documentation (#2189) + - Update on build instructions in README and developer guide for all OS - Enhancements: - Add prefix argument to TIFFStackReader to load a subset of TIFF files in a folder (#2239) From 8b3f51bb7cb0574b01cbf510b7c4c1cdbe5ccd4f Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Tue, 10 Feb 2026 11:28:59 +0000 Subject: [PATCH 10/27] Update README with shallow clone instructions Added information about creating a shallow clone with --depth parameter. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3452008e3..451ff8af50 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ In case of development it is useful to be able to build the software directly. Y ```sh git clone git@github.com:TomographicImaging/CIL ``` - +The parameter `--depth 1` can be added to create a shallow clone with a history truncated to the specified number of commits reducing the size of the clone, see [git documentation](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthdepth). ### Building with `pip` #### Install Dependencies From c7e05ab44bce3d8241e7f3de3d5cc8892550a466 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Wed, 25 Feb 2026 13:50:59 +0000 Subject: [PATCH 11/27] fix FindIPP Signed-off-by: Casper da Costa-Luis --- README.md | 13 +++++-------- docs/source/developer_guide.rst | 17 +++++++---------- recipe/bld.bat | 2 +- recipe/build.sh | 2 +- src/Core/cmake/FindIPP.cmake | 8 ++++---- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 451ff8af50..1ffe275faf 100644 --- a/README.md +++ b/README.md @@ -136,9 +136,9 @@ We suggest creating a conda environment with all the dependencies for building C | OS | Command | Status | |----|----|----| -| Linux | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`| Tested | -| Windows | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`| Tested | -| MacOS (ARM) | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development_osx.yml`| Experimental | +| Linux | `conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`| Tested | +| Windows | `conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`| Tested | +| MacOS (ARM) | `conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development_osx.yml`| Experimental | > [!NOTE] > Currently only Linux and Windows are tested and supported. The support on MacOS (ARM) is experimental and certain features are not available/working, such as FFT filtering for FDK. @@ -148,11 +148,8 @@ We suggest creating a conda environment with all the dependencies for building C A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following commands should work: - -| OS | Build Command | -|----|----| -| Linux | `pip install --no-deps . -Ccmake.define.IPP_ROOT=$CONDA_PREFIX`| -| Windows | `pip install --no-deps . -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%`| +```sh +pip install -e . > [!NOTE] > You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index b9a70356b5..4906332305 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -141,13 +141,13 @@ We suggest creating a conda environment with all the dependencies for building C - Command - Status * - Linux - - ``conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`` + - ``conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`` - Tested * - Windows - - ``conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`` + - ``conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`` - Tested * - MacOS (ARM) - - ``conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development_osx.yml`` + - ``conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development_osx.yml`` - Experimental .. note:: @@ -162,12 +162,9 @@ A C++ compiler is required to build the source code. Let's suppose that the user :header-rows: 1 :widths: 20 80 - * - OS - - Build Command - * - Linux - - ``pip install --no-deps . -Ccmake.define.IPP_ROOT=$CONDA_PREFIX`` - * - Windows - - ``pip install --no-deps . -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%`` +.. code::sh + + pip install -e . .. note:: You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. @@ -178,7 +175,7 @@ If not installing inside a conda environment, then the user might need to set th .. code:: sh - pip install . -Ccmake.define.IPP_ROOT="" -Ccmake.define.OpenMP_ROOT="" + pip install -e . -Ccmake.define.IPP_ROOT="" -Ccmake.define.OpenMP_ROOT="" -Ccmake.define.CMAKE_BUILD_TYPE=RelWithDebInfo Notes for Windows users """""""""""""""" diff --git a/recipe/bld.bat b/recipe/bld.bat index 06b65a1dc5..97fb90517d 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -4,5 +4,5 @@ set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL=%PKG_VERSION% if not "%GIT_DESCRIBE_NUMBER%"=="0" ( set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL=%PKG_VERSION%.dev%GIT_DESCRIBE_NUMBER%+%GIT_DESCRIBE_HASH% ) -pip install . --no-deps -Ccmake.define.IPP_ROOT=%CONDA_PREFIX% +pip install . --no-deps if errorlevel 1 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh index f81c5a9751..93f548655a 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -13,4 +13,4 @@ export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL="${PKG_VERSION}" if test "${GIT_DESCRIBE_NUMBER}" != "0"; then export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL="${PKG_VERSION}.dev${GIT_DESCRIBE_NUMBER}+${GIT_DESCRIBE_HASH}" fi -pip install . --no-deps -Ccmake.args="${extra_args}" -Ccmake.define.IPP_ROOT=${CONDA_PREFIX} +pip install . --no-deps -Ccmake.args="${extra_args}" diff --git a/src/Core/cmake/FindIPP.cmake b/src/Core/cmake/FindIPP.cmake index b0c289c6ee..1c1495cdc4 100644 --- a/src/Core/cmake/FindIPP.cmake +++ b/src/Core/cmake/FindIPP.cmake @@ -10,10 +10,10 @@ elseif(NOT WIN32) set(IPP_PRE "lib") set(IPP_POST ".so") endif() -find_library(IPP_CORE ${IPP_PRE}ippcore${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) -find_library(IPP_S ${IPP_PRE}ipps${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) -find_library(IPP_VM ${IPP_PRE}ippvm${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) -find_library(IPP_I ${IPP_PRE}ippi${IPP_POST} PATHS ${IPP_ROOT_DIR} ${IPP_ROOT_DIR}/Library/lib) +find_library(IPP_CORE ${IPP_PRE}ippcore${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) +find_library(IPP_S ${IPP_PRE}ipps${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) +find_library(IPP_VM ${IPP_PRE}ippvm${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) +find_library(IPP_I ${IPP_PRE}ippi${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) if(IPP_INCLUDE_DIR AND IPP_CORE AND IPP_S AND IPP_VM AND IPP_I) message(STATUS "IPP found in: ${IPP_ROOT_DIR}") From 36179bc66ebf7ed14a4b6c691e577ed06c0138c5 Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> Date: Thu, 9 Apr 2026 11:47:32 +0100 Subject: [PATCH 12/27] Apply suggestion from @Neonbluestoplight Co-authored-by: Nalin Gupta Signed-off-by: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> --- docs/source/developer_guide.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 4906332305..a64e473d4a 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -185,12 +185,13 @@ Install Visual Studio Community (or higher) and select the **Desktop development If you are developing on Windows with conda, you need to have access to both the Visual Studio compiler and the conda environment. You can achieve this in two ways: + 1. by opening a "Developer Command Prompt for Visual Studio" and activating the conda environment from there. This requires you -to know the path to the `conda.bat` file, which is typically located in the `condabin` subdirectory of your conda installation. -Once located you need to run `\conda.bat activate ` to activate the conda environment, and then you can run the build command from there. -2. by opening the conda prompt and running the `vcvarsall.bat x64` file from the Visual Studio installation (with `x64` argument). -This requires you to know the path to the `vcvarsall.bat` file, -which is typically located in the `VC/Auxiliary/Build` subdirectory of your Visual Studio installation. + to know the path to the ``conda.bat`` file, which is typically located in the ``condabin`` subdirectory of your conda installation. + Once located you need to run ``\conda.bat activate `` to activate the conda environment, and then you can run the build command from there. +2. by opening the conda prompt and running the ``vcvarsall.bat x64`` file from the Visual Studio installation (with ``x64`` argument). + This requires you to know the path to the ``vcvarsall.bat`` file, + which is typically located in the ``VC/Auxiliary/Build`` subdirectory of your Visual Studio installation. Building documentation locally ------------------------------ From 89504b1a52be066825181760c8557aa5f59ae050 Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:02:44 +0100 Subject: [PATCH 13/27] Apply suggestions from code review Co-authored-by: Casper da Costa-Luis Co-authored-by: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> Co-authored-by: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Signed-off-by: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> --- README.md | 5 ++--- docs/source/developer_guide.rst | 16 ++++++++++------ src/Core/cmake/FindIPP.cmake | 8 ++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4de8f65835..76ac6c9991 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ The parameter `--depth 1` can be added to create a shallow clone with a history #### Install Dependencies -We suggest creating a conda environment with all the dependencies for building CIL running the following shell script depending on operating system: +We suggest creating a conda environment with all the dependencies for building CIL using the appropriate command for your operating system: | OS | Command | Status | |----|----|----| @@ -146,11 +146,10 @@ We suggest creating a conda environment with all the dependencies for building C #### Build CIL -A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following commands should work: +A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following command should work: ```sh pip install -e . - > [!NOTE] > You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index a64e473d4a..848a95ee18 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -16,9 +16,6 @@ Developers' Guide ***************** - - - CIL is an Object Orientated software. It has evolved during the years and it currently does not fully adhere to the following conventions. New additions must comply with the following. @@ -131,7 +128,7 @@ Building with ``pip`` Install Dependencies """""""""""""""""" -We suggest creating a conda environment with all the dependencies for building CIL running the following shell script depending on operating system: +We suggest creating a conda environment with all the dependencies for building CIL using the appropriate command for your operating system: .. list-table:: :header-rows: 1 @@ -179,20 +176,27 @@ If not installing inside a conda environment, then the user might need to set th Notes for Windows users """""""""""""""" +One option for development on Windows is using [WSL](:https://learn.microsoft.com/en-us/windows/wsl/install#change-the-default-linux-distribution-installed). +Launch WSL and install build-essential using: +``apt install build-essentials`` +This will enable you to then follow the linux instructions for creating the environment and building CIL. + +Alternatively, to use Windows itself... Install Visual Studio Community (or higher) and select the **Desktop development with C++** workload. -If you are developing on Windows with conda, you need to have access to both the Visual Studio compiler and the conda environment. +If you are developing on Windows with conda, you need to have access to both the Visual Studio compiler and have created the conda environment using the command for Windows above. You can achieve this in two ways: 1. by opening a "Developer Command Prompt for Visual Studio" and activating the conda environment from there. This requires you to know the path to the ``conda.bat`` file, which is typically located in the ``condabin`` subdirectory of your conda installation. Once located you need to run ``\conda.bat activate `` to activate the conda environment, and then you can run the build command from there. -2. by opening the conda prompt and running the ``vcvarsall.bat x64`` file from the Visual Studio installation (with ``x64`` argument). +2. by opening the conda prompt and running the ``vcvarsall.bat x64`` file from the Visual Studio installation (with ``x64`` argument), and then running the build command. This requires you to know the path to the ``vcvarsall.bat`` file, which is typically located in the ``VC/Auxiliary/Build`` subdirectory of your Visual Studio installation. +Note: we tested these instructions with Visual Studio 2026 version 18.1.1 Building documentation locally ------------------------------ diff --git a/src/Core/cmake/FindIPP.cmake b/src/Core/cmake/FindIPP.cmake index 1c1495cdc4..070b7ad215 100644 --- a/src/Core/cmake/FindIPP.cmake +++ b/src/Core/cmake/FindIPP.cmake @@ -10,10 +10,10 @@ elseif(NOT WIN32) set(IPP_PRE "lib") set(IPP_POST ".so") endif() -find_library(IPP_CORE ${IPP_PRE}ippcore${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) -find_library(IPP_S ${IPP_PRE}ipps${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) -find_library(IPP_VM ${IPP_PRE}ippvm${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) -find_library(IPP_I ${IPP_PRE}ippi${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES Library/lib) +find_library(IPP_CORE ${IPP_PRE}ippcore${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES lib Library/lib) +find_library(IPP_S ${IPP_PRE}ipps${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES lib Library/lib) +find_library(IPP_VM ${IPP_PRE}ippvm${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES lib Library/lib) +find_library(IPP_I ${IPP_PRE}ippi${IPP_POST} PATHS ${IPP_ROOT_DIR} $ENV{CONDA_PREFIX} PATH_SUFFIXES lib Library/lib) if(IPP_INCLUDE_DIR AND IPP_CORE AND IPP_S AND IPP_VM AND IPP_I) message(STATUS "IPP found in: ${IPP_ROOT_DIR}") From 7e84ee47b38d05da441b3bfb7180c475ab9fb3a7 Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd Date: Fri, 10 Apr 2026 14:51:55 +0100 Subject: [PATCH 14/27] Move instructions out of readme --- README.md | 57 +-------------------------------- docs/source/developer_guide.rst | 26 +++++++++++++-- 2 files changed, 25 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 76ac6c9991..ed607d3e76 100644 --- a/README.md +++ b/README.md @@ -120,62 +120,7 @@ Jupyter Notebooks usage examples without any local installation are provided in ## Building CIL from source code -### Getting the code - -In case of development it is useful to be able to build the software directly. You should clone this repository as - -```sh -git clone git@github.com:TomographicImaging/CIL -``` -The parameter `--depth 1` can be added to create a shallow clone with a history truncated to the specified number of commits reducing the size of the clone, see [git documentation](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthdepth). -### Building with `pip` - -#### Install Dependencies - -We suggest creating a conda environment with all the dependencies for building CIL using the appropriate command for your operating system: - -| OS | Command | Status | -|----|----|----| -| Linux | `conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`| Tested | -| Windows | `conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`| Tested | -| MacOS (ARM) | `conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development_osx.yml`| Experimental | - -> [!NOTE] -> Currently only Linux and Windows are tested and supported. The support on MacOS (ARM) is experimental and certain features are not available/working, such as FFT filtering for FDK. - - -#### Build CIL - -A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following command should work: - -```sh -pip install -e . -> [!NOTE] -> You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. - -If not installing inside a conda environment, then the user might need to set the locations of optional libraries: - -```sh -pip install . -Ccmake.define.IPP_ROOT="" -Ccmake.define.OpenMP_ROOT="" -``` - -### Building with Docker - -In the repository root, simply update submodules and run `docker build`: - -```sh -git submodule update --init --recursive -docker build . -t ghcr.io/tomographicimaging/cil -``` - -### Testing - -Once installed, CIL functionality can be tested using the following command: - -```sh -export TESTS_FORCE_GPU=1 # optional, makes GPU test failures noisy -python -m unittest discover -v ./Wrappers/Python/test -``` +For instructions on how to build CIL from source code, please see our [Developers' Guide](https://tomographicimaging.github.io/CIL/nightly/developer_guide/) ## Citing CIL diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 848a95ee18..5fed33c869 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -116,12 +116,15 @@ Getting the code ^^^^^^^^^^^^^^^^ In case of local development and testing it is useful to be able to build the software directly. -You should first clone this repository as +You should first clone this repository as: .. code:: sh git clone git@github.com:TomographicImaging/CIL +The parameter `--depth 1` can be added to create a shallow clone with a history truncated to the specified number of commits reducing the size of the clone, see [git documentation](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthdepth). +### Building with `pip` + Building with ``pip`` ^^^^^^^^^^^^^^^^^^^^^ @@ -167,7 +170,6 @@ A C++ compiler is required to build the source code. Let's suppose that the user You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS. - If not installing inside a conda environment, then the user might need to set the locations of optional libraries: .. code:: sh @@ -197,6 +199,26 @@ You can achieve this in two ways: which is typically located in the ``VC/Auxiliary/Build`` subdirectory of your Visual Studio installation. Note: we tested these instructions with Visual Studio 2026 version 18.1.1 + + +Building with Docker +^^^^^^^^^^^^^^^^^^^^^ +In the repository root, simply update submodules and run `docker build`: + +.. code:: sh + git submodule update --init --recursive + docker build . -t ghcr.io/tomographicimaging/cil + + +Testing +^^^^^^^ +Once installed, CIL functionality can be tested using the following command: + +.. code:: sh + export TESTS_FORCE_GPU=1 # optional, makes GPU test failures noisy + python -m unittest discover -v ./Wrappers/Python/test + + Building documentation locally ------------------------------ From 222e9e63d26ee37339a076484048bbf1342b1533 Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd Date: Fri, 10 Apr 2026 15:42:37 +0100 Subject: [PATCH 15/27] update doc instructions and remove old scripts --- docs/source/developer_guide.rst | 6 +- .../create_local_env_for_cil_development.sh | 115 ------------------ ...ate_local_env_for_cil_development_tests.sh | 3 - scripts/requirements-test-windows.yml | 49 -------- 4 files changed, 3 insertions(+), 170 deletions(-) delete mode 100755 scripts/create_local_env_for_cil_development.sh delete mode 100755 scripts/create_local_env_for_cil_development_tests.sh delete mode 100644 scripts/requirements-test-windows.yml diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 5fed33c869..6b38e0099b 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -242,11 +242,11 @@ a HTTP server to view the documentation. Example: :: - git clone --recurse-submodule git@github.com:TomographicImaging/CIL + git clone git@github.com:TomographicImaging/CIL cd CIL - sh scripts/create_local_env_for_cil_development_tests.sh -n NUMPY_VERSION -p PYTHON_VERSION -e ENVIRONMENT_NAME + conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml conda activate ENVIRONMENT_NAME - pip install . + pip install -e . cd docs conda update -n base -c defaults conda conda env update -f docs_environment.yml # with the name field set to ENVIRONMENT_NAME diff --git a/scripts/create_local_env_for_cil_development.sh b/scripts/create_local_env_for_cil_development.sh deleted file mode 100755 index 03293787f6..0000000000 --- a/scripts/create_local_env_for_cil_development.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2020 United Kingdom Research and Innovation -# Copyright 2020 The University of Manchester -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Authors: -# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt - -set -euxo pipefail -numpy='1.24' -python='3.10' -name=cil -test_deps=0 -cil_ver='' -pip_install_pkgs=() - -while getopts hn:p:e:tv: option ; do - case "${option}" in - n) numpy="${OPTARG}" ;; - p) python="${OPTARG}" ;; - e) name="${OPTARG}" ;; - t) test_deps=1 ;; - v) test_deps=1 ; cil_ver="${OPTARG}" ;; - h) - echo "Usage: $0 [-n numpy_version] [-p python_version] [-e environment_name] [-t] [-v cil_version]" - echo 'Where `-t` installs test dependencies, and `-v cil_version` implies `-t`' - exit - ;; - *) - echo "Wrong option passed. Use the -h option to get some help." >&2 - exit 1 - ;; - esac -done - -echo "Numpy $numpy" -echo "Python $python" -echo "Environment name $name" - -conda_args=(create --name="$name" - python="$python" - numpy="$numpy" - cmake'>=3.16' - dxchange'>=0.2.1' - h5py - llvm-openmp - ipp'>=2021.10' - ipp-devel'>=2021.10' - ipp-include'>=2021.10' - matplotlib-base - numba - olefile'>=0.46' - packaging - pillow - python-wget - pywavelets - scikit-image - scipy - tqdm - zenodo_get'>=1.6' -) - -if test "$(uname)" = Linux; then - conda_args+=(libgcc-ng libstdcxx-ng) -fi - -if test -n "$cil_ver"; then - echo "CIL version $cil_ver" - conda_args+=(cil="${cil_ver}") -fi - -if test $test_deps = 0; then - conda_args+=(-c conda-forge -c https://software.repos.intel.com/python/conda --override-channels) -else - conda_args+=( - astra-toolbox=2.1=cuda* - ccpi-regulariser=24.0.1 - cil-data - cvxpy<=1.7.5 - ipywidgets - packaging - python-wget - setuptools - scikit-image - tigre=2.6 - tomophantom=2.0.0 - -c conda-forge - -c https://software.repos.intel.com/python/conda - -c ccpi/label/dev - -c ccpi - --override-channels - ) - pip_install_pkgs+=( - unittest-parametrize - ) -fi - -conda "${conda_args[@]}" -if [[ -n "${pip_install_pkgs[@]}" ]]; then - env_path=$(conda info --base)/envs/"$name" - if [[ "$OSTYPE" =~ msys|win32|cygwin ]]; then - python_exec="$env_path/python.exe" - else - python_exec="$env_path/bin/python" - fi - "$python_exec" -m pip install "${pip_install_pkgs[@]}" -fi diff --git a/scripts/create_local_env_for_cil_development_tests.sh b/scripts/create_local_env_for_cil_development_tests.sh deleted file mode 100755 index f2fbc7c702..0000000000 --- a/scripts/create_local_env_for_cil_development_tests.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail -$(dirname "$0")/create_local_env_for_cil_development.sh -t "$@" diff --git a/scripts/requirements-test-windows.yml b/scripts/requirements-test-windows.yml deleted file mode 100644 index b14b51ef64..0000000000 --- a/scripts/requirements-test-windows.yml +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2025 United Kingdom Research and Innovation -# Copyright 2025 The University of Manchester -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Authors: -# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt -name: cil_dev -channels: - - conda-forge - - nvidia - - https://software.repos.intel.com/python/conda -dependencies: - - python >=3.10 - - numpy >=1.23,<2 - - ccpi::cil-data >=22 - - ccpi::tigre 2.6 - - ccpi::ccpi-regulariser 24.0.1 - - ccpi::tomophantom 2.0.0 - - astra-toolbox 2.1 cuda* - - cvxpy <= 1.7.5 - - python-wget - - scikit-image - - packaging - - cmake >=3.16 - - setuptools >=64 - - ipp-include 2021.12 - - ipp-devel 2021.12 - - ipp 2021.12 - - ipywidgets - - scipy >=1.4 - - matplotlib-base >=3.3 - - h5py - - pillow - - dxchange >=0.2.1 - - olefile >=0.46 - - pywavelets - - numba - - tqdm - - zenodo_get >=1.6 - - pip - - pip: - - unittest-parametrize From b8e7ed2407fb4f1e78e5e3d8383be6b0fda12984 Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd Date: Fri, 10 Apr 2026 16:09:54 +0100 Subject: [PATCH 16/27] Fix formatting --- docs/source/developer_guide.rst | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 6b38e0099b..cd321b2b12 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -17,7 +17,10 @@ Developers' Guide ***************** CIL is an Object Orientated software. It has evolved during the years and it currently does not fully adhere to the following conventions. New additions must comply with -the following. +the conventions and documentation guidelines described in this section. + + + Conventions on new CIL objects ============================== @@ -110,7 +113,7 @@ Rendered .. automethod:: cil.recon.FBP.FBP.run Building CIL from source code ------------------------------ +============================== Getting the code ^^^^^^^^^^^^^^^^ @@ -122,8 +125,9 @@ You should first clone this repository as: git clone git@github.com:TomographicImaging/CIL -The parameter `--depth 1` can be added to create a shallow clone with a history truncated to the specified number of commits reducing the size of the clone, see [git documentation](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthdepth). -### Building with `pip` +The parameter ``--depth 1`` can be added to create a shallow clone with a history truncated to the specified number of commits reducing the size of the clone. +See `git documentation `_ + Building with ``pip`` ^^^^^^^^^^^^^^^^^^^^^ @@ -158,11 +162,8 @@ Build CIL A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following commands should work: -.. list-table:: - :header-rows: 1 - :widths: 20 80 -.. code::sh +.. code:: sh pip install -e . @@ -178,9 +179,12 @@ If not installing inside a conda environment, then the user might need to set th Notes for Windows users """""""""""""""" -One option for development on Windows is using [WSL](:https://learn.microsoft.com/en-us/windows/wsl/install#change-the-default-linux-distribution-installed). +One option for development on Windows is using `WSL `_ Launch WSL and install build-essential using: -``apt install build-essentials`` + +.. code:: sh + apt install build-essential + This will enable you to then follow the linux instructions for creating the environment and building CIL. Alternatively, to use Windows itself... @@ -203,9 +207,10 @@ Note: we tested these instructions with Visual Studio 2026 version 18.1.1 Building with Docker ^^^^^^^^^^^^^^^^^^^^^ -In the repository root, simply update submodules and run `docker build`: +In the repository root, simply update submodules and run ``docker build``: .. code:: sh + git submodule update --init --recursive docker build . -t ghcr.io/tomographicimaging/cil @@ -215,6 +220,7 @@ Testing Once installed, CIL functionality can be tested using the following command: .. code:: sh + export TESTS_FORCE_GPU=1 # optional, makes GPU test failures noisy python -m unittest discover -v ./Wrappers/Python/test From f56203b14a8bd27c4e5c17ac2f544f534996d517 Mon Sep 17 00:00:00 2001 From: Murgatroyd Date: Fri, 10 Apr 2026 16:53:01 +0100 Subject: [PATCH 17/27] Rearrange docs --- docs/source/developer_guide.rst | 185 ++++++++++++++++---------------- 1 file changed, 92 insertions(+), 93 deletions(-) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index cd321b2b12..6043b39625 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -19,99 +19,6 @@ Developers' Guide CIL is an Object Orientated software. It has evolved during the years and it currently does not fully adhere to the following conventions. New additions must comply with the conventions and documentation guidelines described in this section. - - - -Conventions on new CIL objects -============================== - -For each class there are **essential**, and **non-essential** parameters. The non-essential can be further be divided in **often configured** and **advanced** parameters: - -* essential -* non-essential - - * often-configured - * advanced - -The definition of what are the essential, often-configured and advanced parameters depends on the actual class. - -Creator -------- - -To create an instance of a class, the creator of a class should require the **essential** and **often-configured** parameters as named parameters. - -It should not accept positional arguments `*args` or key-worded arguments `**kwargs` so that the user can clearly understand what parameters are necessary to -create the instance. - -Setter methods and properties ------------------------------ - -Use of `property` is favoured instead of class members to store parameters so that the parameters can be protected. - -The class should provide setter methods to change all the parameters at any time. Setter methods to set multiple parameters at the same time is also accepted. -Setter methods should be named `set_`. The use of `set_` helps IDEs and user to find what they should change in an instance of a class. - - -Other methods -------------- - -Methods that are not meant to be used by the user should have a `_` (underscore) at the beginning of the name. -All methods should follow the convention of small caps underscore separated words. - -Logging and warning -=================== -We follow pythons convention on logging (see e.g. https://docs.python.org/3/howto/logging.html). In particular: - -.. list-table:: Logging and warning guidelines - :header-rows: 1 - :widths: 40 60 - - * - Task you want to perform - - The best tool for the task - * - Display console output for ordinary usage of a command line script or program - - ``print()`` - * - Report events that occur during normal operation of a program - (e.g. for status monitoring or fault investigation) - - A logger’s ``info()`` (or ``debug()`` method for very detailed output for diagnostic purposes) - * - Issue a warning regarding a particular runtime event - - ``warnings.warn()`` if the issue is avoidable and the user's code - should be modified to eliminate the warning. - - A logger’s ``warning()`` method if there is nothing the user can do about - the situation, but the event should still be noted - * - Report an error regarding a particular runtime event - - Raise an exception - - -Documentation -============= - -Docstrings ----------- - -The Core Imaging Library (CIL) follows the `NumpyDoc `_ -style with the `PyData Sphinx HTML theme `_. -When contributing your code please refer to `this `_ link -for docstring formatting and this rendered `example `_. - -Example from ``cil`` -^^^^^^^^^^^^^^^^^^^^ - -The following provides an example of the docstring format used within ``cil``, and the rendered documentation generated from it. - -Source -"""""" - -.. literalinclude:: ../../Wrappers/Python/cil/recon/FBP.py - :caption: `FBP.run method from cil.io.recon.FBP` - :language: python - :pyobject: FBP.run - -Rendered -"""""""" - -.. automethod:: cil.recon.FBP.FBP.run - Building CIL from source code ============================== @@ -225,6 +132,98 @@ Once installed, CIL functionality can be tested using the following command: python -m unittest discover -v ./Wrappers/Python/test +Conventions on new CIL objects +============================== + +For each class there are **essential**, and **non-essential** parameters. The non-essential can be further be divided in **often configured** and **advanced** parameters: + +* essential +* non-essential + + * often-configured + * advanced + +The definition of what are the essential, often-configured and advanced parameters depends on the actual class. + +Creator +------- + +To create an instance of a class, the creator of a class should require the **essential** and **often-configured** parameters as named parameters. + +It should not accept positional arguments `*args` or key-worded arguments `**kwargs` so that the user can clearly understand what parameters are necessary to +create the instance. + +Setter methods and properties +----------------------------- + +Use of `property` is favoured instead of class members to store parameters so that the parameters can be protected. + +The class should provide setter methods to change all the parameters at any time. Setter methods to set multiple parameters at the same time is also accepted. +Setter methods should be named `set_`. The use of `set_` helps IDEs and user to find what they should change in an instance of a class. + + +Other methods +------------- + +Methods that are not meant to be used by the user should have a `_` (underscore) at the beginning of the name. +All methods should follow the convention of small caps underscore separated words. + +Logging and warning +=================== +We follow pythons convention on logging (see e.g. https://docs.python.org/3/howto/logging.html). In particular: + +.. list-table:: Logging and warning guidelines + :header-rows: 1 + :widths: 40 60 + + * - Task you want to perform + - The best tool for the task + * - Display console output for ordinary usage of a command line script or program + - ``print()`` + * - Report events that occur during normal operation of a program + (e.g. for status monitoring or fault investigation) + - A logger’s ``info()`` (or ``debug()`` method for very detailed output for diagnostic purposes) + * - Issue a warning regarding a particular runtime event + - ``warnings.warn()`` if the issue is avoidable and the user's code + should be modified to eliminate the warning. + + A logger’s ``warning()`` method if there is nothing the user can do about + the situation, but the event should still be noted + * - Report an error regarding a particular runtime event + - Raise an exception + + +Documentation +============= + +Docstrings +---------- + +The Core Imaging Library (CIL) follows the `NumpyDoc `_ +style with the `PyData Sphinx HTML theme `_. +When contributing your code please refer to `this `_ link +for docstring formatting and this rendered `example `_. + +Example from ``cil`` +^^^^^^^^^^^^^^^^^^^^ + +The following provides an example of the docstring format used within ``cil``, and the rendered documentation generated from it. + +Source +"""""" + +.. literalinclude:: ../../Wrappers/Python/cil/recon/FBP.py + :caption: `FBP.run method from cil.io.recon.FBP` + :language: python + :pyobject: FBP.run + +Rendered +"""""""" + +.. automethod:: cil.recon.FBP.FBP.run + + + Building documentation locally ------------------------------ From 9010a29ac95aa4b4d95cb7bac945758bca10cfef Mon Sep 17 00:00:00 2001 From: Murgatroyd Date: Tue, 14 Apr 2026 11:21:29 +0100 Subject: [PATCH 18/27] Fix titles --- docs/source/developer_guide.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 6043b39625..05c134d780 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -84,8 +84,10 @@ If not installing inside a conda environment, then the user might need to set th pip install -e . -Ccmake.define.IPP_ROOT="" -Ccmake.define.OpenMP_ROOT="" -Ccmake.define.CMAKE_BUILD_TYPE=RelWithDebInfo + Notes for Windows users -"""""""""""""""" +""""""""""""""""""""""" + One option for development on Windows is using `WSL `_ Launch WSL and install build-essential using: @@ -114,6 +116,7 @@ Note: we tested these instructions with Visual Studio 2026 version 18.1.1 Building with Docker ^^^^^^^^^^^^^^^^^^^^^ + In the repository root, simply update submodules and run ``docker build``: .. code:: sh @@ -124,6 +127,7 @@ In the repository root, simply update submodules and run ``docker build``: Testing ^^^^^^^ + Once installed, CIL functionality can be tested using the following command: .. code:: sh From 66f04618bb19ededb76d5088d3e5ceca84b9ecda Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:51:22 +0100 Subject: [PATCH 19/27] Apply suggestions from code review Co-authored-by: Gemma Fardell <47746591+gfardell@users.noreply.github.com> Signed-off-by: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> --- docs/source/developer_guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 05c134d780..72dda6f6d4 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -88,7 +88,7 @@ If not installing inside a conda environment, then the user might need to set th Notes for Windows users """"""""""""""""""""""" -One option for development on Windows is using `WSL `_ +One option for development on Windows is using `Windows Subsystem for Linux (WSL) `_ Launch WSL and install build-essential using: .. code:: sh From a0db0abc8a657399001fbc961cc98ad9d3195504 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 17 Apr 2026 16:23:26 +0100 Subject: [PATCH 20/27] fix syntax Signed-off-by: Casper da Costa-Luis --- docs/source/developer_guide.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 72dda6f6d4..15360baafd 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -92,6 +92,7 @@ One option for development on Windows is using `Windows Subsystem for Linux (WSL Launch WSL and install build-essential using: .. code:: sh + apt install build-essential This will enable you to then follow the linux instructions for creating the environment and building CIL. From 5b8eeaf8bb450a3b732fa4f7b2b7d33b71ddfd91 Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> Date: Fri, 17 Apr 2026 17:39:10 +0100 Subject: [PATCH 21/27] Apply suggestions from code review Co-authored-by: Gemma Fardell <47746591+gfardell@users.noreply.github.com> Signed-off-by: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> --- docs/source/developer_guide.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 15360baafd..0ad4e63d55 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -97,9 +97,8 @@ Launch WSL and install build-essential using: This will enable you to then follow the linux instructions for creating the environment and building CIL. -Alternatively, to use Windows itself... -Install Visual Studio Community (or higher) and select the **Desktop development with C++** workload. +To build for windows you can install Visual Studio Community (or higher) and select the **Desktop development with C++** workload. If you are developing on Windows with conda, you need to have access to both the Visual Studio compiler and have created the conda environment using the command for Windows above. From b3ae6945e5ec403559217fc1a85df796482e118d Mon Sep 17 00:00:00 2001 From: Murgatroyd Date: Thu, 23 Apr 2026 13:37:52 +0100 Subject: [PATCH 22/27] Move environment files into this PR --- .github/workflows/conda_and_docs_build.yml | 89 ---------------------- 1 file changed, 89 deletions(-) delete mode 100644 .github/workflows/conda_and_docs_build.yml diff --git a/.github/workflows/conda_and_docs_build.yml b/.github/workflows/conda_and_docs_build.yml deleted file mode 100644 index 1907c0dc7d..0000000000 --- a/.github/workflows/conda_and_docs_build.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: conda_and_docs_build - -on: - release: - types: [published] - push: - branches: [ master ] - tags: - - '**' - pull_request: - branches: [ master ] - -jobs: - conda_build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.1.0 - with: - fetch-depth: 0 - - name: conda-build - uses: paskino/conda-package-publish-action@v2.0.0 - with: - subDir: 'recipe' - channels: '-c conda-forge -c intel -c astra-toolbox/label/dev -c cvxgrp -c ccpi --override-channels' - convert_win: false - convert_osx: false - test_pyver: 3.9 - test_npver: 1.22 - - name: Upload artifact of the conda package. - uses: actions/upload-artifact@v3.1.1 - with: - name: cil-package - path: recipe/linux-64/cil* - docs_build: - needs: conda_build - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.1.0 - with: - fetch-depth: 0 - - name: change directory - run: | - ls - - name: Download artifact of the conda package. - uses: actions/download-artifact@v3.0.1 - with: - name: 'cil-package' - path: 'conda_package' - - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3.7 - - uses: lauramurgatroyd/build-sphinx-action@v0.1.3 - with: - DOCS_PATH: 'docs' - CONDA_BUILD_ENV_FILEPATH: 'docs/docs_environment.yml' - ARTIFACT_NAME: 'DocumentationHTML' - PACKAGE_FOLDER_PATH: 'conda_package' - PACKAGE_NAME: 'cil' - PACKAGE_CONDA_CHANNELS: 'conda-forge -c intel -c astra-toolbox/label/dev -c cvxgrp -c ccpi' - BUILD_SUBDIR_NAME: 'nightly' - docs_publish: - needs: docs_build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - steps: - - name: Download artifact of the html output. - uses: actions/download-artifact@v3.0.1 - with: - name: DocumentationHTML - path: docs/build - - name: Commit documentation changes - run: | - git clone https://github.com/TomographicImaging/CIL.git --branch gh-pages --single-branch gh-pages - cp -r docs/build/* gh-pages/ - cd gh-pages - touch .nojekyll - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Update documentation" -a || true - # The above command will fail if no changes were present, so we ignore - # that. - - name: Push changes - uses: ad-m/github-push-action@v0.6.0 - with: - branch: gh-pages - directory: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} - From 669eaf05e5b078df5e8d212018507ab8113f2405 Mon Sep 17 00:00:00 2001 From: Murgatroyd Date: Fri, 24 Apr 2026 11:20:15 +0100 Subject: [PATCH 23/27] Move env.yml scripts to live in CIL --- CHANGELOG.md | 3 ++- docs/source/developer_guide.rst | 16 +++++++++++---- scripts/cil_development.yml | 36 +++++++++++++++++++++++++++++++++ scripts/cil_development_osx.yml | 26 ++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 scripts/cil_development.yml create mode 100644 scripts/cil_development_osx.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a31697160..cdeec1f3dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,9 +16,10 @@ - cvxpy version set to !=1.8.2 to fix #2303 (#2306) - Update to TomoPhantom v3.0 (#2287) - Handle regularisation toolkit CPU only package error message (#2302) + - Update FindIPP.cmake to find IPP libraries in conda environments (#2286) - Documentation: - Render the user showcase notebooks in the documentation (#2189) - - Update on build instructions in README and developer guide for all OS + - Update on build instructions in README and developer guide for all OS (#2286) - Enhancements: - Add prefix argument to TIFFStackReader to load a subset of TIFF files in a folder (#2239) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 0ad4e63d55..9aa1fb4b5c 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -52,18 +52,26 @@ We suggest creating a conda environment with all the dependencies for building C - Command - Status * - Linux - - ``conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`` + - ``conda env create -f ./scripts/cil_development.yml`` - Tested * - Windows - - ``conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml`` + - ``conda env create -f ./scripts/cil_development.yml`` - Tested * - MacOS (ARM) - - ``conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development_osx.yml`` + - ``conda env create -f ./scripts/cil_development_osx.yml`` - Experimental .. note:: Currently only Linux and Windows are tested and supported. The support on MacOS (ARM) is experimental and certain features are not available and not working, such as FFT filtering for FDK. +This will create an environment called `cil_dev`. + +Activate the environment with: + +.. code:: sh + + conda activate cil_dev + Build CIL """""""" @@ -104,7 +112,7 @@ If you are developing on Windows with conda, you need to have access to both the You can achieve this in two ways: -1. by opening a "Developer Command Prompt for Visual Studio" and activating the conda environment from there. This requires you +1. by opening "x64 Native Tools Command Prompt for VS" and activating the conda environment from there. This requires you to know the path to the ``conda.bat`` file, which is typically located in the ``condabin`` subdirectory of your conda installation. Once located you need to run ``\conda.bat activate `` to activate the conda environment, and then you can run the build command from there. 2. by opening the conda prompt and running the ``vcvarsall.bat x64`` file from the Visual Studio installation (with ``x64`` argument), and then running the build command. diff --git a/scripts/cil_development.yml b/scripts/cil_development.yml new file mode 100644 index 0000000000..69d16d4744 --- /dev/null +++ b/scripts/cil_development.yml @@ -0,0 +1,36 @@ +name: cil_dev +channels: + - conda-forge + - https://software.repos.intel.com/python/conda +dependencies: + - python=3.12 + - pip + - numpy=1.26 + - scipy + - numba + - llvm-openmp + - ipp-include 2021.12 + - ipp-devel 2021.12 + - ipp 2021.12 + - matplotlib-base >=3.3.0 + - astra-toolbox=2.1=cuda* + - scikit-image + - dxchange >=0.2.1 + - olefile >=0.46 + - cvxpy!=1.8.2 + - zenodo_get >=1.6 + - h5py + - pillow + - pywavelets + - ccpi::cil-data >=22 + - ccpi::ccpi-regulariser=24.0.1 + - ccpi::tomophantom=2.0.0 + - ccpi::tigre=2.6 + - tqdm + - python-wget + - zenodo_get >=1.6 + - packaging + - ipywidgets + - pip: + - unittest-parametrize + \ No newline at end of file diff --git a/scripts/cil_development_osx.yml b/scripts/cil_development_osx.yml new file mode 100644 index 0000000000..195149f340 --- /dev/null +++ b/scripts/cil_development_osx.yml @@ -0,0 +1,26 @@ +name: cil_dev +channels: + - conda-forge + - https://software.repos.intel.com/python/conda +dependencies: + - python=3.12 + - pip + - numpy=1.26 + - numba + - llvm-openmp + - matplotlib-base >=3.3.0 + - astra-toolbox=2.1=py* + - scikit-image + - dxchange >=0.2.1 + - olefile >=0.46 + - cvxpy!=1.8.2 + - zenodo_get >=1.6 + - h5py + - pillow + - pywavelets + - ccpi::cil-data >=22 + - tqdm + - python-wget + - pip: + - unittest-parametrize + \ No newline at end of file From ebff6f1b468429082d0c0d0df408edb2925fd2ce Mon Sep 17 00:00:00 2001 From: Murgatroyd Date: Fri, 24 Apr 2026 11:23:32 +0100 Subject: [PATCH 24/27] tomophantom version --- scripts/cil_development.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cil_development.yml b/scripts/cil_development.yml index 69d16d4744..ee0c4cff47 100644 --- a/scripts/cil_development.yml +++ b/scripts/cil_development.yml @@ -24,7 +24,7 @@ dependencies: - pywavelets - ccpi::cil-data >=22 - ccpi::ccpi-regulariser=24.0.1 - - ccpi::tomophantom=2.0.0 + - ccpi::tomophantom=3.0.3 - ccpi::tigre=2.6 - tqdm - python-wget From 0285624783b4ef9c010752850ae93dc5da2fd195 Mon Sep 17 00:00:00 2001 From: Murgatroyd Date: Fri, 24 Apr 2026 11:39:57 +0100 Subject: [PATCH 25/27] update env instructions in docs instructions --- docs/source/developer_guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 9aa1fb4b5c..10667f9da0 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -261,7 +261,7 @@ Example: :: git clone git@github.com:TomographicImaging/CIL cd CIL - conda env create -f https://tomography.stfc.ac.uk/scripts/env/cil_development.yml + conda env create -f ./scripts/cil_development.yml conda activate ENVIRONMENT_NAME pip install -e . cd docs From f8dff1efe2985e02b40215e5a141ab6133e27585 Mon Sep 17 00:00:00 2001 From: Murgatroyd Date: Tue, 5 May 2026 09:44:19 +0100 Subject: [PATCH 26/27] Arrange yml files to match requirements-test.yml order --- scripts/cil_development.yml | 46 +++++++++++++++++++++------------ scripts/cil_development_osx.yml | 32 ++++++++++++++++------- 2 files changed, 52 insertions(+), 26 deletions(-) diff --git a/scripts/cil_development.yml b/scripts/cil_development.yml index ee0c4cff47..78b24a57dd 100644 --- a/scripts/cil_development.yml +++ b/scripts/cil_development.yml @@ -1,36 +1,48 @@ +# Copyright 2023 United Kingdom Research and Innovation +# Copyright 2023 The University of Manchester +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Authors: +# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt name: cil_dev channels: - conda-forge - https://software.repos.intel.com/python/conda dependencies: - python=3.12 - - pip - numpy=1.26 - - scipy - - numba - llvm-openmp + - ccpi::cil-data >=22 + - ccpi::tigre=2.6 + - ccpi::ccpi-regulariser=24.0.1 + - ccpi::tomophantom=3.0.3 + - astra-toolbox=2.1=cuda* + - cvxpy!=1.8.2 + - python-wget + - scikit-image + - packaging - ipp-include 2021.12 - ipp-devel 2021.12 - ipp 2021.12 - - matplotlib-base >=3.3.0 - - astra-toolbox=2.1=cuda* - - scikit-image - - dxchange >=0.2.1 - - olefile >=0.46 - - cvxpy!=1.8.2 - - zenodo_get >=1.6 + - ipywidgets + - scipy + - matplotlib-base >=3.3.0 - h5py - pillow + - dxchange >=0.2.1 + - olefile >=0.46 - pywavelets - - ccpi::cil-data >=22 - - ccpi::ccpi-regulariser=24.0.1 - - ccpi::tomophantom=3.0.3 - - ccpi::tigre=2.6 + - numba - tqdm - - python-wget - zenodo_get >=1.6 - - packaging - - ipywidgets + - pip - pip: - unittest-parametrize \ No newline at end of file diff --git a/scripts/cil_development_osx.yml b/scripts/cil_development_osx.yml index 195149f340..c530490633 100644 --- a/scripts/cil_development_osx.yml +++ b/scripts/cil_development_osx.yml @@ -1,26 +1,40 @@ +# Copyright 2023 United Kingdom Research and Innovation +# Copyright 2023 The University of Manchester +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Authors: +# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt name: cil_dev channels: - conda-forge - https://software.repos.intel.com/python/conda dependencies: - python=3.12 - - pip - numpy=1.26 - - numba - llvm-openmp - - matplotlib-base >=3.3.0 + - ccpi::cil-data >=22 + - numba - astra-toolbox=2.1=py* - - scikit-image - - dxchange >=0.2.1 - - olefile >=0.46 - cvxpy!=1.8.2 - - zenodo_get >=1.6 + - python-wget + - scikit-image + - matplotlib-base >=3.3.0 - h5py - pillow + - dxchange >=0.2.1 + - olefile >=0.46 - pywavelets - - ccpi::cil-data >=22 + - numba - tqdm - - python-wget + - zenodo_get >=1.6 + - pip - pip: - unittest-parametrize \ No newline at end of file From 3fef59df7a5fc89b797150750dbcd6f7d8efeaaa Mon Sep 17 00:00:00 2001 From: Laura Murgatroyd Date: Wed, 6 May 2026 11:09:16 +0100 Subject: [PATCH 27/27] Merge requirements-test and cil_development yml files --- .github/workflows/README.md | 2 +- .github/workflows/build.yml | 10 +++---- Dockerfile | 4 +-- README.md | 2 +- docs/docs_environment.yml | 2 +- scripts/cil_development.yml | 22 ++++++++------- scripts/requirements-test.yml | 50 ----------------------------------- 7 files changed, 22 insertions(+), 70 deletions(-) delete mode 100644 scripts/requirements-test.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md index fdc5864db6..ebb9777552 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -52,7 +52,7 @@ This github action builds and optionally publishes the documentation located in The [docs](./build.yml#L124) job: -- creates a `miniconda` environment from [requirements-test.yml](../../scripts/requirements-test.yml) and [docs_environment.yml](../../docs/docs_environment.yml) +- creates a `miniconda` environment from [cil_development.yml](../../scripts/cil_development.yml) and [docs_environment.yml](../../docs/docs_environment.yml) - `cmake` builds & installs CIL into the `miniconda` environment + builds the HTML documentation with `sphinx` - installs ruby dependencies from [`Gemfile`](../../docs/Gemfile) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2888675d9a..411bddae4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,11 +37,11 @@ jobs: run: | envname="${GITHUB_REPOSITORY##*/}-${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}" echo "envname=$envname" >> $GITHUB_OUTPUT - sed -ri -e 's/^(name: ).*/\1$envname/' -e '/ python /d' -e 's/(.* numpy) .*/\1=${{ matrix.numpy-version }}/' scripts/requirements-test.yml + sed -ri -e 's/^(name: ).*/\1$envname/' -e '/ python /d' -e 's/(.* numpy) .*/\1=${{ matrix.numpy-version }}/' scripts/cil_development.yml - uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} - environment-file: scripts/requirements-test.yml + environment-file: scripts/cil_development.yml activate-environment: ${{ steps.reqs.outputs.envname }} run-post: false - id: build @@ -72,11 +72,11 @@ jobs: - uses: actions/checkout@v4 with: {fetch-depth: 0, submodules: recursive} - name: set requirements - run: sed -ri -e '/ python /d' -e 's/(.* numpy) .*/\1=${{ matrix.numpy-version }}/' -e 's/=cuda*//' -e '/tigre/d' scripts/requirements-test.yml + run: sed -ri -e '/ python /d' -e 's/(.* numpy) .*/\1=${{ matrix.numpy-version }}/' -e 's/=cuda*//' -e '/tigre/d' scripts/cil_development.yml - uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} - environment-file: scripts/requirements-test.yml + environment-file: scripts/cil_development.yml activate-environment: cil_dev - run: pip install . - name: test @@ -224,7 +224,7 @@ jobs: - name: install dependencies run: | mamba install -c conda-forge -yq conda-merge - conda-merge ../scripts/requirements-test.yml docs_environment.yml > environment.yml + conda-merge ../scripts/cil_development.yml docs_environment.yml > environment.yml mamba env update -n test --file environment.yml conda list - run: pip install .. diff --git a/Dockerfile b/Dockerfile index 5c508e0d71..6708a0ec72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,9 @@ LABEL org.opencontainers.image.licenses="Apache-2.0 AND BSD-3-Clause AND GPL-3.0 # CUDA-specific packages ARG CIL_EXTRA_PACKAGES="tigre=2.6 astra-toolbox=2.1.0=cuda*" # build & runtime dependencies -# TODO: sync scripts/create_local_env_for_cil_development.sh, scripts/requirements-test.yml, recipe/meta.yaml (e.g. missing libstdcxx-ng _openmp_mutex pip)? +# TODO: sync scripts/create_local_env_for_cil_development.sh, scripts/cil_development.yml, recipe/meta.yaml (e.g. missing libstdcxx-ng _openmp_mutex pip)? # vis. https://github.com/TomographicImaging/CIL/pull/1590 -COPY --chown="${NB_USER}" scripts/requirements-test.yml environment.yml +COPY --chown="${NB_USER}" scripts/cil_development.yml environment.yml # channel_priority: https://stackoverflow.com/q/58555389 RUN sed -ri '/tigre|astra-toolbox| python /d' environment.yml \ && for pkg in 'jupyter-server-proxy>4.1.0' $CIL_EXTRA_PACKAGES; do echo " - $pkg" >> environment.yml; done \ diff --git a/README.md b/README.md index 24ce8d7a85..1bfa24e52f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ A number of additional dependencies are required for specific functionality in C #### Binary packages and dependencies -While building the CIL package we test with specific versions of dependencies. These are listed in the [build.yml](https://github.com/TomographicImaging/CIL/blob/master/.github/workflows/build.yml) GitHub workflow and [environment-test.yml](https://github.com/TomographicImaging/CIL/blob/master/scripts/requirements-test.yml). The following table tries to resume the tested versions of CIL and its required and optional dependencies. If you use these packages as a backend please remember to cite them in addition to CIL. +While building the CIL package we test with specific versions of dependencies. These are listed in the [build.yml](https://github.com/TomographicImaging/CIL/blob/master/.github/workflows/build.yml) GitHub workflow and [cil_development.yml](https://github.com/TomographicImaging/CIL/blob/master/scripts/cil_development.yml). The following table tries to resume the tested versions of CIL and its required and optional dependencies. If you use these packages as a backend please remember to cite them in addition to CIL. | Package | Tested Version | Conda install command | Description | License | |----|----|--------|--------|----| diff --git a/docs/docs_environment.yml b/docs/docs_environment.yml index c24e24d6e0..78ba3a5697 100644 --- a/docs/docs_environment.yml +++ b/docs/docs_environment.yml @@ -18,7 +18,7 @@ channels: - ccpi - defaults dependencies: - # in addition to CIL deps (see ../scripts/requirements-test.yml) + # in addition to CIL deps (see ../scripts/cil_development.yml) - jinja2 # - pydata-sphinx-theme - recommonmark diff --git a/scripts/cil_development.yml b/scripts/cil_development.yml index 78b24a57dd..e04acb04a2 100644 --- a/scripts/cil_development.yml +++ b/scripts/cil_development.yml @@ -14,26 +14,29 @@ name: cil_dev channels: - conda-forge + - nvidia - https://software.repos.intel.com/python/conda dependencies: - - python=3.12 - - numpy=1.26 + - python >=3.10 + - numpy >=1.23,<2 - llvm-openmp - - ccpi::cil-data >=22 - - ccpi::tigre=2.6 - - ccpi::ccpi-regulariser=24.0.1 - - ccpi::tomophantom=3.0.3 - - astra-toolbox=2.1=cuda* + - ccpi::cil-data >=22 + - ccpi::tigre 2.6 + - ccpi::ccpi-regulariser 24.0.1 + - ccpi::tomophantom 3.0.3 + - astra-toolbox 2.1 cuda* - cvxpy!=1.8.2 - python-wget - scikit-image - packaging + - cmake >=3.16 + - setuptools >=64 - ipp-include 2021.12 - ipp-devel 2021.12 - ipp 2021.12 - ipywidgets - - scipy - - matplotlib-base >=3.3.0 + - scipy >=1.4 + - matplotlib-base >=3.3 - h5py - pillow - dxchange >=0.2.1 @@ -45,4 +48,3 @@ dependencies: - pip - pip: - unittest-parametrize - \ No newline at end of file diff --git a/scripts/requirements-test.yml b/scripts/requirements-test.yml deleted file mode 100644 index e04acb04a2..0000000000 --- a/scripts/requirements-test.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2023 United Kingdom Research and Innovation -# Copyright 2023 The University of Manchester -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Authors: -# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt -name: cil_dev -channels: - - conda-forge - - nvidia - - https://software.repos.intel.com/python/conda -dependencies: - - python >=3.10 - - numpy >=1.23,<2 - - llvm-openmp - - ccpi::cil-data >=22 - - ccpi::tigre 2.6 - - ccpi::ccpi-regulariser 24.0.1 - - ccpi::tomophantom 3.0.3 - - astra-toolbox 2.1 cuda* - - cvxpy!=1.8.2 - - python-wget - - scikit-image - - packaging - - cmake >=3.16 - - setuptools >=64 - - ipp-include 2021.12 - - ipp-devel 2021.12 - - ipp 2021.12 - - ipywidgets - - scipy >=1.4 - - matplotlib-base >=3.3 - - h5py - - pillow - - dxchange >=0.2.1 - - olefile >=0.46 - - pywavelets - - numba - - tqdm - - zenodo_get >=1.6 - - pip - - pip: - - unittest-parametrize