[Numpy-discussion] suggested change of behavior for interp

Nathaniel Smith njs at pobox.com
Wed Jun 5 03:54:53 EDT 2013


On 5 Jun 2013 03:21, "Eric Firing" <efiring at hawaii.edu> wrote:
>
> On 2013/06/04 4:15 PM, Benjamin Root wrote:
> > Could non-monotonicity be detected as part of the interp process?
> > Perhaps a sign switch in the deltas?
>
> There are two code paths, depending on the number of points to be
> interpolated.  When it is greater than the size of the table, the deltas
> are pre-computed in a single sweep.  Non-monotonicity could be detected
> there at moderate cost.  In the other code path, for a smaller number of
> points, the deltas are computed only as needed, so monotonicity testing
> would require a separate sweep through the points.  That's the costly
> case that I think might reasonably be an option but that should not be
> required.

Nonetheless, perhaps the function should at least be safe by default? I'm
worried by these multiple reports of people silently getting wrong answers
in practice...

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130605/b0e7c810/attachment.html>


More information about the NumPy-Discussion mailing list