Skip to content

Fix resample/interpolate for non-upsampling case #1608

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

Merged
merged 3 commits into from
Oct 5, 2017
Merged

Fix resample/interpolate for non-upsampling case #1608

merged 3 commits into from
Oct 5, 2017

Conversation

jhamman
Copy link
Member

@jhamman jhamman commented Oct 4, 2017

cc @darothen

@jhamman jhamman changed the title regression test for 1605 Fix resample/interpolate for non-upsampling case Oct 4, 2017
@darothen
Copy link

darothen commented Oct 5, 2017

Great catch; do you need any input from me @jhamman ?

@jhamman
Copy link
Member Author

jhamman commented Oct 5, 2017

@darothen - if this makes sense to you, we can let @shoyer give the final 👍 .

Copy link
Member

@shoyer shoyer left a comment

Choose a reason for hiding this comment

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

I like these "move one line of code" fixes!

dims=('time', 'x', 'y'),
coords={'time': dates})
actual = expected.resample(time='1D').interpolate('linear')
self.assertDataArrayAllClose(actual, expected, rtol=1e-16)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jhamman reminder to use the assert functions rather than self. ... methods, for future PRs

@jhamman
Copy link
Member Author

jhamman commented Oct 5, 2017

yes, this was a nice and easy fix. In the future, it may be nice to fast track no-op resample/interpolation since this does end up doing the same computation as it would if there were actual missing values but, this is a nice improvement for now.

Thanks again @darothen for the upsampling and resample refactor.

@jhamman jhamman merged commit 8710e08 into pydata:master Oct 5, 2017
@jhamman jhamman deleted the fix/1605 branch October 5, 2017 16:34
@darothen
Copy link

darothen commented Oct 5, 2017

I'm a bit slow on the uptake here, but big 👍 from me. Thanks for catching this bug!

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