-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
API for N-dimensional combine #2616
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
shoyer
merged 111 commits into
pydata:master
from
TomNicholas:feature/nd_combine_new_api
Jun 25, 2019
Merged
Changes from all commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
88ee12a
concatenates along a single dimension
TomNicholas 1aaa075
Wrote function to find correct tile_IDs from nested list of datasets
TomNicholas dbb371d
Wrote function to check that combined_tile_ids structure is valid
TomNicholas cc4d743
Added test of 2d-concatenation
TomNicholas d2fc7e7
Tests now check that dataset ordering is correct
TomNicholas e3f3699
Test concatentation along a new dimension
TomNicholas 55bf685
Started generalising auto_combine to N-D by integrating the N-D conca…
TomNicholas 845206c
All unit tests now passing
TomNicholas fb66626
Merge branch 'real_master' into feature/nd_combine
TomNicholas f4e9aad
Fixed a failing test which I didn't notice because I don't have pseud…
TomNicholas 00004a1
Began updating open_mfdataset to handle N-D input
TomNicholas b41e374
Refactored to remove duplicate logic in open_mfdataset & auto_combine
TomNicholas 8672a79
Implemented Shoyers suggestion in #2553 to rewrite the recursive nest…
TomNicholas 4f56b24
--amend
TomNicholas 4cfaf2e
Now raises ValueError if input not ordered correctly before concatena…
TomNicholas 9fd1413
Added some more prototype tests defining desired behaviour more clearly
TomNicholas 8ad0121
Now raises informative errors on invalid forms of input
TomNicholas 4b2c544
Refactoring to alos merge along each dimension
TomNicholas 3d0061e
Refactored to literally just apply the old auto_combine along each di…
TomNicholas 60c93ba
Added unit tests for open_mfdatset
TomNicholas 1824538
Removed TODOs
TomNicholas d380815
Removed format strings
TomNicholas c4bb8d0
test_get_new_tile_ids now doesn't assume dicts are ordered
TomNicholas 6b7f889
Fixed failing tests on python3.5 caused by accidentally assuming dict…
TomNicholas 58a3648
Test for getting new tile id
TomNicholas a12a34a
Fixed itertoolz import so that it's compatible with older versions
TomNicholas ada1f4a
Increased test coverage
TomNicholas ef0a30e
Added toolz as an explicit dependency to pass tests on python2.7
TomNicholas 3be70bc
Updated 'what's new'
TomNicholas f266bc3
No longer attempts to shortcut all concatenation at once if concat_di…
TomNicholas cf49c2b
Merge branch 'master' into feature/nd_combine
TomNicholas 878e1f9
Rewrote using itertools.groupby instead of toolz.itertoolz.groupby to…
TomNicholas 7dea14f
Merged changes from master
TomNicholas e6f25a3
Fixed erroneous removal of utils import
TomNicholas f856485
Updated docstrings to include an example of multidimensional concaten…
TomNicholas 6305d83
Clarified auto_combine docstring for N-D behaviour
TomNicholas ce59da1
Added unit test for nested list of Datasets with different variables
TomNicholas 9fb34cf
Minor spelling and pep8 fixes
TomNicholas 83dedb3
Started working on a new api with both auto_combine and manual_combine
TomNicholas de199a0
Merged master
TomNicholas 3e64a83
Wrote basic function to infer concatenation order from coords.
TomNicholas 963c794
Attempt at finalised version of public-facing API.
TomNicholas 1a66530
No longer uses entire old auto_combine internally, only concat or merge
TomNicholas 38d265e
Merged v0.11.1 and v0.11.2 changes
TomNicholas 7525b23
Updated what's new
TomNicholas 92e120a
Removed uneeded addition to what's new for old release
TomNicholas 13a7f75
Fixed incomplete merge in docstring for open_mfdataset
TomNicholas b76e681
Tests for manual combine passing
TomNicholas c09df8b
Tests for auto_combine now passing
TomNicholas 953d572
xfailed weird behaviour with manual_combine trying to determine conca…
TomNicholas b7bf1ad
Add auto_combine and manual_combine to API page of docs
TomNicholas 855d819
Tests now passing for open_mfdataset
TomNicholas de7965e
Attempted to merge master in, but #2648 has stumped me
TomNicholas bfcb4e3
Completed merge so that #2648 is respected, and added tests.
TomNicholas eb053cc
Separated the tests for concat and both combines
TomNicholas 97e508c
Some PEP8 fixes
TomNicholas 410b138
Pre-empting a test which will fail with opening uamiv format
TomNicholas 02b6d05
Satisfy pep8speaks bot
TomNicholas 0d6f13a
Python 3.5 compatibile after changing some error string formatting
TomNicholas 18e0074
Order coords using pandas.Index objects
TomNicholas 67f11f3
Fixed performance bug from GH #2662
TomNicholas 3b843f5
Removed ToDos about natural sorting of string coords
TomNicholas 540d3d4
Merged master into branch
TomNicholas bb98d54
Generalized auto_combine to handle monotonically-decreasing coords too
TomNicholas e3f7523
Added more examples to docstring for manual_combine
TomNicholas fc36b74
Merged master - includes py2 deprecation
TomNicholas d96595e
Added note about globbing aspect of open_mfdataset
TomNicholas 79f09c0
Removed auto-inferring of concatenation dimension in manual_combine
TomNicholas e32adb3
Added example to docstring for auto_combine
TomNicholas da4d605
Minor correction to docstring
TomNicholas c4fe22c
Another very minor docstring correction
TomNicholas 66b4c4f
Added test to guard against issue #2777
TomNicholas 90f0c1d
Started deprecation cycle for auto_combine
TomNicholas 0990dd4
Fully reverted open_mfdataset tests
TomNicholas d6277be
Updated what's new to match deprecation cycle
TomNicholas b81e77a
Merge branch 'real_master' into feature/nd_combine_new_api
TomNicholas bf7d549
Reverted uamiv test
TomNicholas f00770f
Removed dependency on itertools
TomNicholas c7c1746
Deprecation tests fixed
TomNicholas f6192ca
Satisfy pycodestyle
TomNicholas 88f089e
Started deprecation cycle of auto_combine
TomNicholas 2849559
merged changes from master for v0.12
TomNicholas 535bc31
Added specific error for edge case combine_manual can't handle
TomNicholas 5d818e0
Check that global coordinates are monotonic
TomNicholas 42cd05d
Highlighted weird behaviour when concatenating with no data variables
TomNicholas 8a83814
Added test for impossible-to-auto-combine coordinates
TomNicholas e4acbdc
Removed uneeded test
TomNicholas 8e767e2
Satisfy linter
TomNicholas 3d04112
Added airspeedvelocity benchmark for combining functions
TomNicholas 06ecef6
Benchmark will take longer now
TomNicholas 513764f
Updated version numbers in deprecation warnings to fit with recent re…
TomNicholas 13364ff
Updated api docs for new function names
TomNicholas ddfc6dd
Fixed docs build failure
TomNicholas e471a42
Revert "Fixed docs build failure"
TomNicholas 2d5b90f
Updated documentation with section explaining new functions
TomNicholas 8cbf5e1
Merged master
TomNicholas 9ead34e
Suppressed deprecation warnings in test suite
TomNicholas fab3586
Resolved ToDo by pointing to issue with concat, see #2975
TomNicholas 9d5e29f
Various docs fixes
TomNicholas 9a33ac6
Merged master, resolving conflicts with #2964
TomNicholas ae7b811
Slightly renamed tests to match new name of tested function
TomNicholas f4fc03d
Included minor suggestions from shoyer
TomNicholas 917ebee
Removed trailing whitespace
TomNicholas 1e537ba
Simplified error message for case combine_manual can't handle
TomNicholas 7d6845b
Removed filter for deprecation warnings, and added test for if user d…
TomNicholas 5083471
Simple fixes suggested by shoyer
TomNicholas 4cc70ae
Change deprecation warning behaviour
TomNicholas 537c405
Merged in recent changes to master
TomNicholas 2f54127
Merge branch 'master' into feature/nd_combine_new_api
dcherian 357531f
linting
TomNicholas e006875
Merge branch 'feature/nd_combine_new_api' of https://github.com/TomNi…
TomNicholas 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import numpy as np | ||
import xarray as xr | ||
|
||
|
||
class Combine: | ||
"""Benchmark concatenating and merging large datasets""" | ||
|
||
def setup(self): | ||
"""Create 4 datasets with two different variables""" | ||
|
||
t_size, x_size, y_size = 100, 900, 800 | ||
t = np.arange(t_size) | ||
data = np.random.randn(t_size, x_size, y_size) | ||
|
||
self.dsA0 = xr.Dataset( | ||
{'A': xr.DataArray(data, coords={'T': t}, | ||
dims=('T', 'X', 'Y'))}) | ||
self.dsA1 = xr.Dataset( | ||
{'A': xr.DataArray(data, coords={'T': t + t_size}, | ||
dims=('T', 'X', 'Y'))}) | ||
self.dsB0 = xr.Dataset( | ||
{'B': xr.DataArray(data, coords={'T': t}, | ||
dims=('T', 'X', 'Y'))}) | ||
self.dsB1 = xr.Dataset( | ||
{'B': xr.DataArray(data, coords={'T': t + t_size}, | ||
dims=('T', 'X', 'Y'))}) | ||
|
||
def time_combine_manual(self): | ||
datasets = [[self.dsA0, self.dsA1], [self.dsB0, self.dsB1]] | ||
|
||
xr.combine_manual(datasets, concat_dim=[None, 't']) | ||
|
||
def time_auto_combine(self): | ||
"""Also has to load and arrange t coordinate""" | ||
datasets = [self.dsA0, self.dsA1, self.dsB0, self.dsB1] | ||
|
||
xr.combine_auto(datasets) |
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.
Uh oh!
There was an error while loading. Please reload this page.