soft-matter / trackpy

Python particle tracking toolkit
http://soft-matter.github.io/trackpy
Other
445 stars 131 forks source link

Refine leastsq: add warning for scipy 1.5 and skip tests #650

Closed caspervdw closed 3 years ago

caspervdw commented 3 years ago

Closes #644

As far as I understand, scipy 1.5 started using a different (more feature-rich) function to make numerical derivatives. This function is more strict on the output on SLSQP (the fortran minimize algorithm). SLSQP unexpectedly does not completely stay inside the parameter bounds you supply, giving errors / warnings from the new function.

See related Scipy issue: https://github.com/scipy/scipy/pull/13009

This was only partially solved in scipy 1.5, and completely in 1.6. Trackpy unfortunately still suffers from the issue with 1.5.4, so I chose to emit a warning to recommend users to upgrade/downgrade scipy in this case. The unittests are skipped on scipy 1.5.