Original ticket http://projects.scipy.org/scipy/ticket/1393 on 2011-02-24 by trac user Dave Hirschfeld, assigned to unknown.
This was originally reported on the list -
A self-contained example is given below and attached in case the line-endings get mangled...
from scipy.interpolate import splev, splint, splrep
from scipy.integrate import quad
from numpy import allclose
y = array([ 0.38608245, 0.33937334, 0.30557594, 0.29031793, 0.27597413,
0.26680583, 0.25012443, 0.24310048, 0.23825924, 0.23260759,
0.22179233, 0.21821583, 0.2164903 , 0.21275566, 0.20813042,
0.20404953, 0.19703265, 0.19649831, 0.19548709, 0.1922062 ,
x = ones(y.size)/4
x /= 2
x = x.cumsum()
tck = splrep(x, y, s=0.0001)
lhs = splint(0.2, 0.3, tck)
rhs = quad(lambda v: splev(v, tck, der=0), 0.2, 0.3)
assert allclose(lhs, rhs, 1e-6, 1e-12), "splint != quad. region = [0.2, 0.3]"
lhs = splint(0, 0.1, tck)
rhs = quad(lambda v: splev(v, tck, der=0), 0, 0.1)
assert allclose(lhs, rhs, 1e-6, 1e-12), "splint != quad. region = [0, 0.1]"
lhs = splint(0.1, 0.2, tck)
rhs = quad(lambda v: splev(v, tck, der=0), 0.1, 0.2)
assert allclose(lhs, rhs, 1e-6, 1e-12), "splint != quad. region = [0.1, 0.2]"
Attachment added by trac user Dave Hirschfeld on 2011-02-24: test_splint.py
@WarrenWeckesser wrote on 2011-02-24
Wrapped code sample in triple curly brackets.
@pv wrote on 2011-02-25
splint assumes the function is zero outside the data interval.
This is probably not a documentation issue only, as the zero assumption is not what is typically wanted.
Milestone changed to Unscheduled by @rgommers on 2011-08-27
I think there shouldn't be done anything else here. With the added note in the docstring,splint works as advertised. While this might not be what users want sometimes, it seems this is impossible to fix within the frame of the current FITPACK implementation.
Agreed, I don't think this is easily fixed in any other way.
We'll do it in a better way without breaking backward compat, when the new B-spline stuff gets done.