CCPi-Regularisation-Toolkit icon indicating copy to clipboard operation
CCPi-Regularisation-Toolkit copied to clipboard

Adding tests with pytest

Open dkazanc opened this issue 9 months ago • 4 comments

CuPy requires for CUDA kernels to be present during the build. I've modified the build.sh and bld.bat files to do that.

@paskino A question about a CuPy dependency. It can be optional for the user to install CuPy or not, but I think I'll add the tests so they run if it is present in the environment (TODO). Do you have a some kind of reusable external environment in your CI where you run tests for the toolkit? Could you install CuPy there? thanks

dkazanc avatar May 14 '24 09:05 dkazanc

@paskino this PR covers #206 #208 and #207 issues.

  • CuPy modules are getting installed correctly during conda build
  • unittest replaced by pytests and extended to 3D (additional --runcupy flag needed to run CuPy tests and switched off by default)
  • Lena image is replaced by Pepper
  • All Demos have been updated accordingly

dkazanc avatar Jul 01 '24 21:07 dkazanc

In CIL we run some tests with the regularisation toolkit, see https://github.com/TomographicImaging/CIL/blob/master/Wrappers/Python/test/test_PluginsRegularisation.py

CuPy is not a pre-requisite in our CI https://github.com/TomographicImaging/CIL/blob/b3d8ffeeec9413a3b54264e4097a445d2ef5b88b/recipe/meta.yaml#L33-L42

paskino avatar Jul 04 '24 11:07 paskino

In CIL we run some tests with the regularisation toolkit, see https://github.com/TomographicImaging/CIL/blob/master/Wrappers/Python/test/test_PluginsRegularisation.py

That should still work I guess.

CuPy is not a pre-requisite in our CI https://github.com/TomographicImaging/CIL/blob/b3d8ffeeec9413a3b54264e4097a445d2ef5b88b/recipe/meta.yaml#L33-L42

I haven't added CuPy in the list of dependencies, it is optional. The CuPy tests require an additional flag. The CuPy import modules are also independent, so the non-CuPy users shouldn't notice any difference.

dkazanc avatar Jul 05 '24 08:07 dkazanc

hi, any progress with this PR? As with minimal dependencies package I'd also like to add a PyPi uploading, will do in a separate PR after this merged. thanks

dkazanc avatar Aug 28 '24 13:08 dkazanc