-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Groupby-like API for resampling #1272
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
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
0767397
Implement basic functionality by adding "DataArrayResample" and "Data…
fce727f
Re-factor old resample logic to separate method
afa31fc
Adding test cases for new api
829b4c1
Adding more DataArray resample tests
9b742c4
Adding test_dataset test cases
0ec8b71
Update to use proxy __resample_dim__ on resampling ops
09a6989
Re-factor proxy resampling dimension and catch rare error if used as …
afa14e4
BUG: Fixed loss of attrs on DatasetResample even when keep_attrs=True
1fec1f9
Update docs to add information about new resampling api
4f70131
Adding 'Whats new' entry
3a05c50
Tweak auxiliary groupby apply and reduce methods
464a067
Squash bugs from py.test following rebase to master
c213de9
Fixing typo in groupby.py
db500d2
Add a test for resampling which includes timezones in the datetime st…
4f29932
Rolling back the timezone tests... this will need to be tackled separ…
5f4d6a5
Re-factored resample into it's own module for easier maintenance
3e2cc45
Adding support for 'count' via old api
a98bb2e
Re-organizing new vs old resampling api tests
2664b8e
Expanded old-vs-new api tests for Dataset to replace deprecated tests
ee4b2ef
Consolidated old reasmpling api tests into new-vs-old for dataarray
07e6fb1
Wrapping old api test invocations with pytest.warns
304e250
Added stub tests for upsampling
949291a
Update documentation with upsampling stub
c898b23
Factor out a Resample object and add initial up-sampling methods - bf…
37c8e8b
Add interpolation up-sampling to DataArray
6949c06
Refine DataArray upsampling interpolation and extend to Dataset
d85fa81
Fix wrong time dimension length on test cases for upsampling
4177d79
First initial revisions to @shoyer's comments; before modifying imple…
a7bd1fd
Tweaks to resample.py to lean on super-methods
0f071ee
Implementing interpolation test cases
985600e
BUG: Fix asfreq only returning 1D data in nd case
2e985c6
Add pad/asfreq upsampling tests
bc58b05
Add a check if old/new api is mixed; remove old api details from resa…
529406f
Fix an old bug in datetime components of timeseries doc
b6cf938
Tweaking time-series doc
406f4e2
Added what's new entry
ce97f3a
Drop existing non-dimension coordinates along resample dimension
2a7efee
Update seaborn to v0.8 to fix issues with default plot styles
829d292
nearest-neighbor up-sampling now relies on re-index instead of interp…
38f6d86
Adding nearest upsampling test; tweaked inference of re-indexing dime…
b2307d0
Move what's new entry to breaking changes
85ed5ba
Updating docs in breaking changes with example and link to timeseries…
5082040
BUG: Fixing creating merged coordinates for Dataset upsampling case
ed8d5c9
Remove old notice about resampling api updates
5d23a99
Applying shoyer's clean-up of figuring out valid coords on Dataset up…
8c7d6cf
Add note about monotonicity assumption before interpolation
31e5510
fix some pep8 and comments
9b43d00
More informative error message when resampling/interpolating dask arrays
2839107
Merge branch 'master' into refactor-resample-api
9a92211
Fix flake8
6df6dde
Fixing issues with test cases, including adding one for upsampling da…
af1ab3d
Merge branch 'master' into refactor-resample-api
d03b25f
Clean up scipy imports
dd11565
Adding additional tweaks to cover scipy/numpy dependencies in tests
5cfba57
Merge branch 'master' into refactor-resample-api
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be better way to handle this, but currently using
RESAMPLE_DIM
is actually pretty critical here, and removing it is probably the source of some of the bugs you are seeing with your new implementation. The problem is we need to keep track of the resampled time variable in a dataset along with the original time variable. If we give the resampled group variable the same name, then xarray gets them mixed up.