Scipy: Strictly increasing requirement in UnivariateSpline

Created on 7 Mar 2018  路  5Comments  路  Source: scipy/scipy

I am trying to describe a large dataset using an Univariate spline. With a previous Scipy 0.19 version this worked nicely, now the same data gives with a current Scipy 1.0 the error message

x must be strictly increasing

According to the current documentation at https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.UnivariateSpline.html it is enough if x is increasing.

The error message is caused by the commit https://github.com/scipy/scipy/commit/8b37277f721eb0f69b2aa4644a961ba0b84e665c which adds a checks for strictly increasing x. On the other hand in the issue https://github.com/scipy/scipy/issues/1753 it is mentioned that the strictly increasing requirement has been lifted already.

So does the current documentation need to be updated to include the "strictly" requirement or would a test for increasing x be sufficient? I am not familiar with the underlying routines and maybe overlooking some detail here.

defect scipy.interpolate

Most helpful comment

Has this been fixed? I still get the same error.

All 5 comments

A possible way forward would be to relax the check to allow diff(x)==0 and add a test checking that it does not raise. A pull request would be helpful.

If nobody has taken this up yet I'd be willing to work on it.

@TimothyWillard all yours 馃槂

btw, the same issue exists for InterpolatedUnivariateSpline

Has this been fixed? I still get the same error.

Was this page helpful?
0 / 5 - 0 ratings