Closed stevemolloy closed 2 years ago
It seems that this exception is thrown from pylandau.pyx
, and is a result of scipy.optimize.fmin
not converging when called in the function _scale_to_mpv
.
Thank you for your bug report. You are right, the issue is not in pylandau
itself but a scipy module it uses. May I ask why it makes sense to support a MPV
that is 4 orders larger than the eta
? As a workaround you can right now just shift the distribution by 10^5. The shifting could also be implemented as a solution to this bug to be still able to use scipy.optimize.fmin
on extreme parameter values.
No problem. You're right to note that it is probably a little nonsensical to use such extreme values. I discovered this when using Python Hypothesis to test my code.
https://github.com/stevemolloy/BLMs/tree/master
This testing framework works by sending a statistically large number of wildly different inputs to confirm that the code responds as expected -- an extremely robust way to test. I discovered this issue with PyLandau when Hypothesis used these very extreme values.
I agree that it is not a critical bug in your project. Very much an edge case :) Thanks for responding.
Ok :-). I will put this on may to do list for the next release. To test the functionality of pyLandau
I might also consider hypothesis. Did not know about it. THX.
A parameter difference over 9 orders of magnitude reaches the numerical precision of all scipy
minimizers that I tested. I added unit tests with hypothesis and determined parameter ranges where sane results with no crashes can be expected. These are listed here. All fitting and unit test functions should obey to these limits.
When the code with limits is released this issue will be closed.
Sounds good. Thanks for keeping me up to date.
This should be fixed with the current release that includes the fixes from @DavidLP. Closing the issue now, feel free to reopen/open another one if the problem persists.
Note the very large value of mpv.
No such error is reported for mpv=1e9. The threshold for causing this error is somewhere between 8.5899345e9 and 8.5899346e9.
I'm using OS X 10.11.6