TomographicImaging / CIL

A versatile python framework for tomographic imaging
https://tomographicimaging.github.io/CIL/
Apache License 2.0
88 stars 40 forks source link

test_SIRF fails #1846

Closed KrisThielemans closed 1 week ago

KrisThielemans commented 1 week ago

SIRF-SuperBuild docker tests gave https://github.com/SyneRBI/SIRF-SuperBuild/pull/906#issuecomment-2182972823

ERROR: test_SIRF (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_SIRF
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/opt/conda/lib/python3.10/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/jovyan/cil_sirf_test/test_SIRF.py", line 29, in <module>
    from cil.optimisation.utilities import AdaptiveSensitivity
ImportError: cannot import name 'AdaptiveSensitivity' from 'cil.optimisation.utilities' (/opt/conda/lib/python3.10/site-packages/cil/optimisation/utilities/__init__.py)

I believe this is due to https://github.com/TomographicImaging/CIL/blob/8449f663bb585c3f5744a7aff78937b6f12d7e20/Wrappers/Python/test/test_SIRF.py#L29 as the class sits in preconditioner

KrisThielemans commented 1 week ago

I've updated my own VM (still an easy way to test things out...). Confusingly to me, both

from cil.optimisation.utilities.preconditioner import AdaptiveSensitivity

(this PR) and

from cil.optimisation.utilities import AdaptiveSensitivity

(master) work fine. The VM uses Python 3.10.12, and the docker as well.

There is another reason for https://github.com/SyneRBI/SIRF-SuperBuild/pull/906 therefore.