-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace SortedKeysDict with dict #4753
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
Changes from all commits
fdf72c8
650bb53
6110bf1
ef55555
1d5f4fd
0625586
4f8be16
1727377
ed50311
2a99687
6b97895
d984cb8
137157f
effb64e
1c2cb33
8946771
2cac794
d0949ca
a8cec8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -675,7 +675,6 @@ def combine_by_coords( | |
they are concatenated based on the values in their dimension coordinates, | ||
not on their position in the list passed to `combine_by_coords`. | ||
|
||
|
||
>>> x1 = xr.Dataset( | ||
... { | ||
... "temperature": (("y", "x"), 20 * np.random.rand(6).reshape(2, 3)), | ||
|
@@ -700,7 +699,7 @@ def combine_by_coords( | |
|
||
>>> x1 | ||
<xarray.Dataset> | ||
Dimensions: (x: 3, y: 2) | ||
Dimensions: (y: 2, x: 3) | ||
Coordinates: | ||
* y (y) int64 0 1 | ||
* x (x) int64 10 20 30 | ||
|
@@ -710,7 +709,7 @@ def combine_by_coords( | |
|
||
>>> x2 | ||
<xarray.Dataset> | ||
Dimensions: (x: 3, y: 2) | ||
Dimensions: (y: 2, x: 3) | ||
Coordinates: | ||
* y (y) int64 2 3 | ||
* x (x) int64 10 20 30 | ||
|
@@ -720,7 +719,7 @@ def combine_by_coords( | |
|
||
>>> x3 | ||
<xarray.Dataset> | ||
Dimensions: (x: 3, y: 2) | ||
Dimensions: (y: 2, x: 3) | ||
Coordinates: | ||
* y (y) int64 2 3 | ||
* x (x) int64 40 50 60 | ||
|
@@ -730,7 +729,7 @@ def combine_by_coords( | |
|
||
>>> xr.combine_by_coords([x2, x1]) | ||
<xarray.Dataset> | ||
Dimensions: (x: 3, y: 4) | ||
Dimensions: (y: 4, x: 3) | ||
Coordinates: | ||
* y (y) int64 0 1 2 3 | ||
* x (x) int64 10 20 30 | ||
|
@@ -740,30 +739,30 @@ def combine_by_coords( | |
|
||
>>> xr.combine_by_coords([x3, x1]) | ||
<xarray.Dataset> | ||
Dimensions: (x: 6, y: 4) | ||
Dimensions: (y: 4, x: 6) | ||
Coordinates: | ||
* x (x) int64 10 20 30 40 50 60 | ||
* y (y) int64 0 1 2 3 | ||
* x (x) int64 10 20 30 40 50 60 | ||
Data variables: | ||
temperature (y, x) float64 10.98 14.3 12.06 nan ... nan 18.89 10.44 8.293 | ||
precipitation (y, x) float64 0.4376 0.8918 0.9637 ... 0.5684 0.01879 0.6176 | ||
|
||
>>> xr.combine_by_coords([x3, x1], join="override") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the existing behavior here a bug? In [16]: x1.dims
Out[16]: Frozen({'y': 2, 'x': 3})
In [17]: x3.dims
Out[17]: Frozen({'y': 2, 'x': 3})
In [18]: xr.combine_by_coords([x3, x1], join="override")
Out[18]:
<xarray.Dataset>
Dimensions: (y: 4, x: 3)
Coordinates:
* x (x) int64 10 20 30
* y (y) int64 0 1 2 3
Data variables:
temperature (y, x) float64 10.98 14.3 12.06 10.9 ... 18.89 10.44 8.293
precipitation (y, x) float64 0.4376 0.8918 0.9637 ... 0.5684 0.01879 0.6176 and
So should the result y dim have length 4? This is changing behavior because the order of dims is changing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checking the repr of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for that reference. I agree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a dfferent bug from #4824? |
||
<xarray.Dataset> | ||
Dimensions: (x: 3, y: 4) | ||
Dimensions: (y: 2, x: 6) | ||
Coordinates: | ||
* x (x) int64 10 20 30 | ||
* y (y) int64 0 1 2 3 | ||
* y (y) int64 0 1 | ||
* x (x) int64 10 20 30 40 50 60 | ||
Data variables: | ||
temperature (y, x) float64 10.98 14.3 12.06 10.9 ... 18.89 10.44 8.293 | ||
temperature (y, x) float64 10.98 14.3 12.06 2.365 ... 18.89 10.44 8.293 | ||
precipitation (y, x) float64 0.4376 0.8918 0.9637 ... 0.5684 0.01879 0.6176 | ||
|
||
>>> xr.combine_by_coords([x1, x2, x3]) | ||
<xarray.Dataset> | ||
Dimensions: (x: 6, y: 4) | ||
Dimensions: (y: 4, x: 6) | ||
Coordinates: | ||
* x (x) int64 10 20 30 40 50 60 | ||
* y (y) int64 0 1 2 3 | ||
* x (x) int64 10 20 30 40 50 60 | ||
Data variables: | ||
temperature (y, x) float64 10.98 14.3 12.06 nan ... 18.89 10.44 8.293 | ||
precipitation (y, x) float64 0.4376 0.8918 0.9637 ... 0.5684 0.01879 0.6176 | ||
|
Uh oh!
There was an error while loading. Please reload this page.