Skip to content

Commit 8819462

Browse files
authored
Merge branch 'master' into fix/plot-broadcast
2 parents ed9948e + fb0cf7b commit 8819462

23 files changed

+1314
-80
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ prune doc/generated
66
global-exclude .DS_Store
77
include versioneer.py
88
include xarray/_version.py
9+
recursive-include xarray/static *

README.rst

+3
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,7 @@ under a "3-clause BSD" license:
138138
xarray also bundles portions of CPython, which is available under the "Python
139139
Software Foundation License" in xarray/core/pycompat.py.
140140

141+
xarray uses icons from the icomoon package (free version), which is
142+
available under the "CC BY 4.0" license.
143+
141144
The full text of these licenses are included in the licenses directory.

doc/examples/multidimensional-coords.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function to specify the output coordinates of the group.
107107
lat_center = np.arange(1, 90, 2)
108108
# group according to those bins and take the mean
109109
Tair_lat_mean = (ds.Tair.groupby_bins('xc', lat_bins, labels=lat_center)
110-
.mean(xr.ALL_DIMS))
110+
.mean(...))
111111
# plot the result
112112
@savefig xarray_multidimensional_coords_14_1.png width=5in
113113
Tair_lat_mean.plot();

doc/groupby.rst

+11-5
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ dimensions *other than* the provided one:
116116

117117
.. ipython:: python
118118
119-
ds.groupby('x').std(xr.ALL_DIMS)
119+
ds.groupby('x').std(...)
120+
121+
.. note::
122+
123+
We use an ellipsis (`...`) here to indicate we want to reduce over all
124+
other dimensions
125+
120126

121127
First and last
122128
~~~~~~~~~~~~~~
@@ -127,7 +133,7 @@ values for group along the grouped dimension:
127133

128134
.. ipython:: python
129135
130-
ds.groupby('letters').first(xr.ALL_DIMS)
136+
ds.groupby('letters').first(...)
131137
132138
By default, they skip missing values (control this with ``skipna``).
133139

@@ -142,7 +148,7 @@ coordinates. For example:
142148

143149
.. ipython:: python
144150
145-
alt = arr.groupby('letters').mean(xr.ALL_DIMS)
151+
alt = arr.groupby('letters').mean(...)
146152
alt
147153
ds.groupby('letters') - alt
148154
@@ -195,7 +201,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen
195201
'lat': (['ny','nx'], [[10,10],[20,20]] ),},
196202
dims=['ny','nx'])
197203
da
198-
da.groupby('lon').sum(xr.ALL_DIMS)
204+
da.groupby('lon').sum(...)
199205
da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False)
200206
201207
Because multidimensional groups have the ability to generate a very large
@@ -213,4 +219,4 @@ applying your function, and then unstacking the result:
213219
.. ipython:: python
214220
215221
stacked = da.stack(gridcell=['ny', 'nx'])
216-
stacked.groupby('gridcell').sum(xr.ALL_DIMS).unstack('gridcell')
222+
stacked.groupby('gridcell').sum(...).unstack('gridcell')

doc/whats-new.rst

+15
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Breaking changes
2525

2626
New Features
2727
~~~~~~~~~~~~
28+
- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use
29+
`...` directly. As before, you can use this to instruct a `groupby` operation
30+
to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest
31+
using `...`.
32+
By `Maximilian Roos <https://github.com/max-sixty>`_
2833
- Added integration tests against `pint <https://pint.readthedocs.io/>`_.
2934
(:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.
3035

@@ -36,6 +41,12 @@ New Features
3641
``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.
3742
Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.
3843

44+
- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve
45+
representation of objects in jupyter. By default this feature is turned off
46+
for now. Enable it with :py:meth:`xarray.set_options(display_style="html")`.
47+
(:pull:`3425`) by `Benoit Bovy <https://github.com/benbovy>`_ and
48+
`Julia Signell <https://github.com/jsignell>`_.
49+
3950
Bug fixes
4051
~~~~~~~~~
4152
- Fix regression introduced in v0.14.0 that would cause a crash if dask is installed
@@ -47,6 +58,10 @@ Bug fixes
4758
- Fix plotting with transposed 2D non-dimensional coordinates. (:issue:`3138`)
4859
By `Deepak Cherian <https://github.com/dcherian>`_.
4960

61+
- Fix :py:meth:`xarray.core.groupby.DataArrayGroupBy.reduce` and
62+
:py:meth:`xarray.core.groupby.DatasetGroupBy.reduce` when reducing over multiple dimensions.
63+
(:issue:`3402`). By `Deepak Cherian <https://github.com/dcherian/>`_
64+
5065
Documentation
5166
~~~~~~~~~~~~~
5267

0 commit comments

Comments
 (0)