GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
228 stars 107 forks source link

Remove implicit scipy dependency. #1305

Closed jmeyers314 closed 4 months ago

jmeyers314 commented 4 months ago

Addresses #1253 .

Adds a basic Levenberg-Marquardt optimizer that can fill in for scipy.linalg.least_squares in simple cases (such as used in FittedSIPWCS). It's a small bit slower on average, so we might want to consider making it a fallback option when scipy is unavailable though I didn't bother for now. (The fitted sip unit tests takes 3.0 s now, vs. 2.25 s using scipy).

Along the way I also refactored our if __name__ == __main__ test running code so you can use -k testname (similar to pytest) when running directly with python. There are command line options for running the profiler too.