Skip to content
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

BUG: interpolate: integral(a, b) should be zero when both limits are outside of the interpolation range #10633

Merged
merged 1 commit into from
Aug 10, 2019

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Aug 10, 2019

Integrals should be zero when both limits are outside of the interpolation range

fixes gh-7906

The bug was that FITPACK moves the out-of-range upper limit of integration to the upper bound of the base interval, and the out-of-range lower limit to the lower bound. This way, if both limits are, say, above the upper bound, the lower limit stays above it, and the computational routine goes haywire.

@ev-br ev-br added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.interpolate labels Aug 10, 2019
@pv
Copy link
Member

pv commented Aug 10, 2019

Doesn't this depend also on the ext= mode?
Ok, I see it's documented to use zero extension...
I agree we shouldn't touch this but recommend BSpline instead.

@ev-br
Copy link
Member Author

ev-br commented Aug 10, 2019

Yeah, it's zero regardless of the extrapolation mode. We could bolt it on, but it's been like that since forever (?) and I'm not sure we should change it.

@ev-br ev-br changed the title BUG: interpolate: integral(a, b) should be zerowhen both limits are outside of the interpolation range BUG: interpolate: integral(a, b) should be zero when both limits are outside of the interpolation range Aug 10, 2019
Integrals should be zero when both limits are outside
of the interpolation range

fixes scipygh-7906
@pv pv merged commit d4705cc into scipy:master Aug 10, 2019
@pv pv added this to the 1.4.0 milestone Aug 10, 2019
tylerjereddy added a commit to tylerjereddy/scipy that referenced this pull request Jan 20, 2020
* update SciPy 1.2.3 release notes to
include backports for: scipygh-11126, scipygh-10906,
scipygh-10633, scipygh-10138, and scipygh-10076.

* briefly mention in the notes that this
is part of the Python 2.7 LTS support series
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong result from scipy.interpolate.UnivariateSpline.integral for out-of-bounds
2 participants