TomographicImaging / CIL

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

Check Functions for use of methods that modify the input parameters #914

Open paskino opened 3 years ago

paskino commented 3 years ago

Methods like proximal accept an out parameter. However, if used as inline functions as in SPDHG they may not work as expected. https://github.com/TomographicImaging/CIL/blob/39b6f7a722afb6d5f0e2d47a99ce8266378c2a65/Wrappers/Python/cil/optimisation/algorithms/SPDHG.py#L178

gfardell commented 3 years ago

914 fixes this for SPDHG. I'm not sure what we want to do here, I think the user (and us!) should not pass the same object as an input and an output unless the function docstring confirms it is able to be used in place.