Giter Club home page Giter Club logo

Comments (4)

moritzhuetten avatar moritzhuetten commented on June 18, 2024 1

Hi @ev-br , thanks a lot for the quick response. Indeed, I can confirm that the error occurs for (and only for, as far as I see) a dataset with NaNs (and previously, instantiation was possible even with NaNs being present). I will investigate further if I still see a discrepancy in performance for a dataset without NaNs, using the _legacy methods. However, if _legacy methods should be identical to before also if NaNs are present, I can already tell that it does not seem to be the case for me, and I will see if I can create a minimal data set to reproduce it.

from scipy.

ev-br avatar ev-br commented on June 18, 2024
  1. the error indicates that values have infs or nans. This is indeed a problem, and the fact that it worked previously is an accident, really.

  2. _legacy methods should be exactly identical to what it was in the previous scipy releases. If they are not, it's a bug. Would you please be able to add a minimal reproducible example for us to take a look?

from scipy.

moritzhuetten avatar moritzhuetten commented on June 18, 2024

Dear @ev-br , I investigated further and contrarily to what I previously claimed, I see no difference between the _legacy methods in scipy 1.13 and the corresponding methods in scipy < 1.13. So everything seems to work as expected and this issue can be closed I guess. However, let me allow to ask two questions:

  • As the new spline RegularGridInterpolator instantiation may take significantly more time than before for the benefit of faster interpolation afterwards, aren't there case where a different trade-off is desired, i.e., fast instantiation is more important? So to permanently allow to choose the most suitable method in the future?
  • Shouldn't it be possible (at one's own risk) to allow interpolation on a grid containing NaNs?

Thanks a lot again for your support!

from scipy.

ev-br avatar ev-br commented on June 18, 2024

Thanks for confirming the _legacy behavior!

aren't there case where a different trade-off is desired, i.e., fast instantiation is more important? So to permanently allow to choose the most suitable method in the future?

Sure. Only a user can decide what's most suitable for their specific problem though. The best a library can do is to offer a choice, here between cubic or cubic_legacy etc.

Shouldn't it be possible (at one's own risk) to allow interpolation on a grid containing NaNs?

Sure.
Just keep ising linear, nearest and _legacy methods :-).

Alternatively, you can provide your own solver argument. It should look like sparse.linalg.solve or iterative solvers from sparse.linalg, that's the only requirement. See https://github.com/scipy/scipy/blob/main/scipy/interpolate/_ndbspline.py#L355
I'm sceptical TBH --- the 'missing value' nan semantics is inherently at odds with the 'not-a-number' semantics that scipy.linalg and scipy.interpolate adhere to. But don't let my skepticism discourage you, I'd be happy to be proven wrong. So if you manage to make it work, do let us know!

from scipy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.