Re: Deprecate `scipy.integrate.romberg`/`scipy.integrate.quadrature`?

Ralf Gommers <[email protected]> Sat, 2 Dec 2023 17:34:31 +0100
Newsgroups gmane.comp.python.scientific.devel
Message-ID <CABL7CQjHi-RSfgdMOYbnV8rE2yvs1DTUCgViK1tinqfMyzsiNg@mail.gmail.com>
On Wed, Nov 29, 2023 at 3:05 PM Matt Haberland <[email protected]>
wrote:

> But there's no rush for that. We'll open a separate issue about the new
> function and discuss its name when the time comes.
>

Agreed. Such a function may appear in a few months, or never - best to
cross that bridge when we get to it.

For now I think the only thing to decide is whether to deprecate
`quadrature` or not. If it's kept for educational purposes, then all that
needs doing is adding a warning to the docs about its accuracy (no new
`gauss_quad` function either I'd say). And if deprecation is warranted,
then just deprecate it and remove it a few releases later.

Cheers,
Ralf



>
> On Wed, Nov 29, 2023, 5:14 AM Matt Haberland <[email protected]>
> wrote:
>
>> We don't need to reclaim the name. Still, `quadrature` is a bit too
>> generic sounding for a function that shouldn't be relied on as a general
>> purpose routine.
>>
>> The best reason for wanting to reuse the name is lack of imagination. If
>> we don't reclaim the name, what would a good name be for an improved
>> general purpose quadrature function with several methods? I suggested the
>> verb `quadrate`, but I don't think that's commonly used.
>> `scipy.integrate.integrate`?
>>
>> On Wed, Nov 29, 2023, 1:16 AM Ralf Gommers <[email protected]>
>> wrote:
>>
>>>
>>>
>>> On Mon, Nov 27, 2023 at 11:42 PM Matt Haberland <
>>> [email protected]> wrote:
>>>
>>>> Hi team,
>>>>
>>>> Thanks for the feedback on deprecating these functions. There was
>>>> support for deprecating them, but also some concerns, so the plan has
>>>> changed to the following:
>>>>
>>>>    - Deprecate `scipy.integrate.quadrature` (so we can reclaim the
>>>>    name for a more general-purpose function in the future).
>>>>
>>>>
>>> This is something we try to never do. There are very few examples of us
>>> deprecating and then removing a name, and then reintroducing it with
>>> different behavior. There has to be an exceptionally good reason to do so,
>>> and I don't see one in the PR discussion (it's quite long, so I may have
>>> missed it). I can't even think of a potential reason, because the
>>> `quadrature` name isn't special enough that you can't pick a different name
>>> for whatever you want/need here.
>>>
>>> Cheers,
>>> Ralf
>>>
>>>
>>>>    - Introduce `scipy.integrate.gauss_quad` as an alias for
>>>>    `scipy.integrate.quadrature`, and point users to `gauss_quad` in the
>>>>    `quadrature` deprecation messages.
>>>>    - Mark  `scipy.integrate.gauss_quad` and  `scipy.integrate.romberg`
>>>>    as legacy functions.
>>>>
>>>> We welcome additional feedback in gh-19510 (
>>>> https://github.com/scipy/scipy/pull/19510).
>>>> Thanks,
>>>> Matt
>>>>
>>>> On Sat, Nov 11, 2023 at 4:10 PM Matt Haberland <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Team,
>>>>>
>>>>> `scipy.integrate.romberg` and `scipy.integrate.quadrature` do not
>>>>> reliably hit their target accuracies, and when they do, they typically
>>>>> require more function evaluations and take more wall clock time than
>>>>> `scipy.integrate.quad` (all with default settings). This is documented in
>>>>> https://github.com/scipy/scipy/issues/18574#issuecomment-1703320598,
>>>>> which compares the accuracies, function call counts, and wall clock times
>>>>> on a benchmark set of ~800 integrals with known analytical solutions.
>>>>>
>>>>> gh-19510 (https://github.com/scipy/scipy/pull/19510) proposes to
>>>>> deprecate these functions, suggesting `scipy.integrate.quad` as a drop-in
>>>>> replacement. Please let us know your thoughts either here or in gh-19510!
>>>>>
>>>>> Thanks,
>>>>> Matt
>>>>>
>>>> _______________________________________________
>>>> 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]
>>>
>> _______________________________________________
> 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]