port minpack2.dcsrch to Python, future removal of minpack2?

Andrew Nelson <[email protected]> Sun, 13 Aug 2023 22:09:19 +1000
Newsgroups gmane.comp.python.scientific.devel
Message-ID <CAAbtOZcaxfk_jf7vLiLSFKUBMMn3sX32en8Xb-7yOPpw8vVXRA@mail.gmail.com>
Currently `scipy.optimize.minpack2` is used in linesearch operations in
`scipy.optimize._linesearch.line_search_wolfe1`.  minpack2 is a Fortran
module that exports two functions, dcsrch and dcstep.

I have ported the contents of those functions to Python, see a PR on my
fork at https://github.com/andyfaff/scipy/pull/57.

I have examined the relative timings of the Fortran module with the Python
version using the example at
https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.line_search.html,
and there is no difference (albeit for a simple example).

I propose that we switch to using the Python port, as this will be easier
to maintain than the Fortran version. The Python version is a
straightforward translation of the Fortran.

At the moment minpack2 can be imported from scipy.optimize. Its namespace
is deprecated for removal in scipy 2. I'm not sure how much use it actually
gets outside our internal use of it. When we get to that point we could
remove the module.

I'd appreciate thoughts on this proposal.

_______________________________________________
SciPy-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: [email protected]