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

Ralf Gommers <[email protected]> Sun, 13 Aug 2023 20:12:20 +0200
Newsgroups gmane.comp.python.scientific.devel
Message-ID <CABL7CQhKX_SbkJaBgkQ2D_B3C+Uz1hAfSqRRjW=fK=+Okeyz_g@mail.gmail.com>
On Sun, Aug 13, 2023 at 2:10 PM Andrew Nelson <[email protected]> wrote:

> 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.
>

Thank you for translating that code. +1 from me, the Python code will be
much easier to maintain and improve.


> 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.
>

Just remove that namespace I'd say. It was never really meant to be public
to begin with, and it has now been giving deprecation warnings for a while.
We don't have to remove these kinds of namespace without good cause - but a
rewrite is a good cause.

Cheers,
Ralf



>
> 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]
>

_______________________________________________
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]