-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Porting the SciPy tests to Fortran #70
Comments
@mdhaber Is there anything we can provide for numerical stability and edge cases for MINPACK specifically? |
Hmm, I don't know of any. Like stress tests for the underlying algorithms? |
Yes mostly testing the edge cases and maybe stress testing that we are sure it doesn't break at the Fortran side |
By edge cases, do you mean for examples things like NaN or infinity in the initial guess? I believe that MINPACK currently doesn't perform such checks. The question is whether to add such input-checking to the Fortran code, or leave it as the responsibility of the caller (or SciPy wrapper) to perform such checks. A good place to start is maybe to look at the errors that MINPACK detects currently, e.g. in integer, intent(out) :: info !! an integer output variable. if the user has
!! terminated execution, `info` is set to the (negative)
!! value of `iflag`. see description of `fcn`. otherwise,
!! `info` is set as follows:
!!
!! * ***info = 0*** improper input parameters.
!! * ***info = 1*** relative error between two consecutive iterates
!! is at most `xtol`.
!! * ***info = 2*** number of calls to `fcn` has reached or exceeded
!! `maxfev`.
!! * ***info = 3*** `xtol` is too small. no further improvement in
!! the approximate solution `x` is possible.
!! * ***info = 4*** iteration is not making good progress, as
!! measured by the improvement from the last
!! five jacobian evaluations.
!! * ***info = 5*** iteration is not making good progress, as
!! measured by the improvement from the last
!! ten iterations. and compare with the wrappers in SciPy (https://github.com/scipy/scipy/blob/main/scipy/optimize/_minpack_py.py) and figure out what could be simplified by handling in Fortran. |
Historically, we have been quite successful with finding wrapper bugs. What I had in mind is more like ill-conditioned problems, singularities, getting stuck in while loops and so on. But I don't have concrete examples yet. |
There are a number of test collections including ill-conditioned problems. We have issues open for a few (#10, #35) of them. Here are a few original references:
It's just a lot of effort to create the drivers in Fortran (or Python), and integrate them with the CI/CD in a way that we could track the correctness and speed improvements with time. |
Is there any way that I can make life easier for you folks? CI/CD setup is something we can help you with, since we are doing this very often, though I think we don't have much Fortran knowledge. Just copy pasting numbers from horrific PDFs to text files is also fine, any way you need help please let us know. |
One of the suggestions in #14 (comment) was to port the MINPACK tests from SciPy to our test suite.
I've tried to locate some of the relevant files:
Note that some of the test may only be testing properties of the SciPy interface, and not have much to do with Fortran at all.
The text was updated successfully, but these errors were encountered: