Skip to content

RFC: Add more scipy interpolations methods #5067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Conversation

meggart
Copy link

@meggart meggart commented Mar 23, 2021

This extends the list of applicable interpolation methods from scipy's interp1d to match the methods listed in https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html

  • Tests added
  • Passes pre-commit run --all-files
  • User visible changes (including notable bug fixes) are documented in whats-new.rst

Is such a small change worth being included in whats-new.rst?

@meggart meggart changed the title Add more scipy interpolations methods WIP: Add more scipy interpolations methods Mar 23, 2021
@meggart meggart changed the title WIP: Add more scipy interpolations methods RFC: Add more scipy interpolations methods Mar 23, 2021
"cubic",
# "next",
# "previous",
]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would add next and previous to the pandas compat tests as well. However, these interpolation methods are not wrapped by pandas yet, so they currently fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pandas has this functionality in pad/backfill for fillna() rather than in interpolate. That could be a good method to try for the tests here.

Copy link
Contributor

@dcherian dcherian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice first PR @meggart

I have one small suggestion regarding the tests. A whats-new entry would be nice to advertise these cool new capabilities.

"slinear",
"quadratic",
"cubic",
"previous",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check that the output matches that from scipy since we can't use pandas for that

Can you add that check here?

@kmuehlbauer
Copy link
Contributor

There have been additions in #9526 and #9599 in the past. But it looks like there are still interpolators to add. So if there is interest, please open a new PR on top of latest xarray mani branch. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants