Re: Initial kw behaviour for cumulative_trapezoid
Ralf Gommers <[email protected]>
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <CABL7CQgWsvpAGz3e++DgEksSpf3TX=kev8ez2mc6F2_itFuP+A@mail.gmail.com> |
On Thu, Mar 30, 2023 at 4:19 AM Praveer Nidamaluri <[email protected]> wrote: > Thanks Ralf, > As you noted, the only current logical uses for initial are initial=None > and initial=0. The numerical values for these would be the same if we > prepend and sum. Prepending and summing would also make all other values > for `initial` correct and usable as well. > > But, I would be good with what you suggested as well: only provide the > options for 0 and None. > This would explicitly make the purpose of the `initial` kw to match the > lengths of the input and output. > > Would raising an exception be too strong of a change though? > What about: > if `initial` is not None: initial is taken as 0. > A warning can then be provided if initial is not 0 or None to ensure it is > not a silent change. > If it changes, then it should be an exception. Changed numerical values + a warning is strictly worse than getting an error. If the impact of an exception would be too large, then that'd block the change. In this case it kinda breaks our backwards compatibility policy, but the impact seems like it's minor and would be easy to work around. So the change seems justified to me at the moment. Cheers, Ralf I can put up a PR based on whatever is the final consensus and make > cumulative_simpson have the same behaviour. > _______________________________________________ > 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]