Skip to content

Commit

Permalink
Regularisation toolkit 24.0.1 (#1868)
Browse files Browse the repository at this point in the history
* Update regularisation toolkit version and unit tests

* Change data size in unittest

* Update ccpi-regulariser version

* Resize test arrays, revert rename env

* Update changelog

* Update recommended version to install
  • Loading branch information
hrobarts authored Jul 16, 2024
1 parent a725fa7 commit 23e3c05
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- The CIL function class now has a `__neg__` function, so you can write `-YourFunction(x)` rather than `-1*YourFunction(x)` (#1808)
- Added documentation for the Partitioner to `framework.rst` (#1828)
- Added CIL vs SIRF tests comparing preconditioned ISTA in CIL and MLEM in SIRF (#1823)
- Update to CCPi-Regularisation toolkit v24.0.1 (#1868)
- Bug fixes:
- gradient descent `update_objective` called twice on the initial point.(#1789)
- ProjectionMap operator bug fix in adjoint and added documentation (#1743)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ccpi.filters import regularisers
from ccpi.filters.TV import TV_ENERGY
except ImportError as exc:
raise ImportError('Please `conda install "ccpi::ccpi-regulariser>=24"`') from exc
raise ImportError('Please `conda install "ccpi::ccpi-regulariser>=24.0.1"`') from exc


from cil.framework import DataOrder
Expand Down
16 changes: 8 additions & 8 deletions Wrappers/Python/test/test_PluginsRegularisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class TestPlugin(unittest.TestCase):
def setUp(self):
#Default test image
self.data = dataexample.SIMPLE_PHANTOM_2D.get(size=(64,64))
self.data = dataexample.SIMPLE_PHANTOM_2D.get(size=(64,30))
self.alpha = 2.0
self.iterations = 1000

Expand All @@ -46,7 +46,7 @@ def tearDown(self):

@unittest.skipUnless(has_ccpi_regularisation, "Skipping as CCPi Regularisation Toolkit is not installed")
def test_FGP_TV_complex(self):
data = dataexample.CAMERA.get(size=(256,256))
data = dataexample.CAMERA.get(size=(256,100))
datarr = data.as_array()
cmpx = np.zeros(data.shape, dtype=np.complex64)
cmpx.real = datarr[:]
Expand Down Expand Up @@ -90,15 +90,15 @@ def test_FGP_TGV_rmul(self):

@unittest.skipUnless(has_ccpi_regularisation, "Skipping as CCPi Regularisation Toolkit is not installed")
def test_FGP_dTV_rmul(self):
data = dataexample.CAMERA.get(size=(256,256))
data = dataexample.CAMERA.get(size=(256,100))
f = FGP_dTV(data)

self.rmul_test(f)


@unittest.skipUnless(has_ccpi_regularisation, "Skipping as CCPi Regularisation Toolkit is not installed")
def test_functionality_FGP_TV(self):
data = dataexample.CAMERA.get(size=(256,256))
data = dataexample.CAMERA.get(size=(256,100))
datarr = data.as_array()

tau = 1.
Expand All @@ -111,7 +111,7 @@ def test_functionality_FGP_TV(self):

@unittest.skipUnless(has_ccpi_regularisation, "Skipping as CCPi Regularisation Toolkit is not installed")
def test_functionality_TGV(self):
data = dataexample.CAMERA.get(size=(256,256))
data = dataexample.CAMERA.get(size=(256,100))
datarr = data.as_array()

tau = 1.
Expand All @@ -125,7 +125,7 @@ def test_functionality_TGV(self):

@unittest.skipUnless(has_ccpi_regularisation, "Skipping as CCPi Regularisation Toolkit is not installed")
def test_functionality_FGP_dTV(self):
data = dataexample.CAMERA.get(size=(256,256))
data = dataexample.CAMERA.get(size=(256,100))
datarr = data.as_array()
ref = data*0.3

Expand Down Expand Up @@ -160,7 +160,7 @@ def test_functionality_TNV(self):
@unittest.skipUnless(has_ccpi_regularisation, "Skipping as CCPi Regularisation Toolkit is not installed")
def test_TNV_raise_on_2D(self):
# data = dataexample.SYNCHROTRON_PARALLEL_BEAM_DATA.get()
data = dataexample.CAMERA.get(size=(256,256))
data = dataexample.CAMERA.get(size=(256,100))
datarr = data.as_array()

tau = 1.
Expand All @@ -173,7 +173,7 @@ def test_TNV_raise_on_2D(self):
@unittest.skipUnless(has_ccpi_regularisation, "Skipping as CCPi Regularisation Toolkit is not installed")
def test_TNV_raise_on_3D_nochannel(self):
# data = dataexample.SYNCHROTRON_PARALLEL_BEAM_DATA.get()
data = dataexample.CAMERA.get(size=(256,256))
data = dataexample.CAMERA.get(size=(256,100))
datarr = data.as_array()
tau = 1.

Expand Down
4 changes: 2 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test:
- tomophantom=2.0.0 # [ linux ]
- tigre=2.6
- packaging
- ccpi-regulariser=24.0.0 # [ not osx ]
- ccpi-regulariser=24.0.1 # [ not osx ]
- astra-toolbox=2.1=cuda* # [ not osx ]

source_files:
Expand Down Expand Up @@ -93,7 +93,7 @@ requirements:
- tomophantom=2.0.0
- astra-toolbox>=1.9.9.dev5,<=2.1
- tigre>=2.4,<=2.6
- ccpi-regulariser=24.0.0
- ccpi-regulariser=24.0.1
- ipywidgets

about:
Expand Down
2 changes: 1 addition & 1 deletion scripts/create_local_env_for_cil_development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if test $test_deps = 0; then
else
conda_args+=(
astra-toolbox=2.1=cuda*
ccpi-regulariser=24.0.0
ccpi-regulariser=24.0.1
cil-data
cvxpy
ipywidgets
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- numpy >=1.23
- ccpi::cil-data
- ccpi::tigre=2.6
- ccpi::ccpi-regulariser=24.0.0
- ccpi::ccpi-regulariser=24.0.1
- ccpi::tomophantom=2.0.0
- astra-toolbox=2.1=cuda*
- cvxpy
Expand Down

0 comments on commit 23e3c05

Please sign in to comment.