On Fri, May 3, 2013 at 6:19 PM, Pauli Virtanen <notifications@github.com>wrote:

> In scipy/interpolate/fitpack.py:
>
> > +
> > +    >>> dspl = splder(spl)
> > +    >>> sproot(dspl) / np.pi
> > +    array([ 0.50000001,  1.5       ,  2.49999998])
> > +
> > +    This agrees well with roots :math:`\pi/2 + n\pi` of `cos(x) = sin'(x)`.
> > +
> > +    """
> > +    if n < 0:
> > +        return splantider(tck, -n)
> > +
> > +    for j in range(n):
> > +        t, c, k = tck
> > +
> > +        if k <= 0:
> > +            # Derivative of a constant is zero
>
> Actually, this is not true as the function can be discontinuous, so
> differentiating should give delta distributions. Which we can't represent.
>
> Should it return NaNs? Or just plaster a warning in the documentation?
>

I limit the number of differentiations to the degree of the spline and
raise an ValueError otherwise.

Chuck

> —
> Reply to this email directly or view it on GitHub<https://github.com/scipy/scipy/pull/2445/files#r4083678>
> .
>