Skip to content

Commit bc39877

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dask-tokenize
* upstream/master: upgrade black verison to 19.10b0 (pydata#3456) Remove outdated code related to compatibility with netcdftime (pydata#3450) Remove deprecated behavior from dataset.drop docstring (pydata#3451) jupyterlab dark theme (pydata#3443) Drop groups associated with nans in group variable (pydata#3406) Allow ellipsis (...) in transpose (pydata#3421) Another groupby.reduce bugfix. (pydata#3403) add icomoon license (pydata#3448) change ALL_DIMS to equal ellipsis (pydata#3418) Escaping dtypes (pydata#3444) Html repr (pydata#3425)
2 parents 507b1f6 + 278d2e6 commit bc39877

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1646
-339
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 11 additions & 5 deletions
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/reshaping.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ Reordering dimensions
1818
---------------------
1919

2020
To reorder dimensions on a :py:class:`~xarray.DataArray` or across all variables
21-
on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`:
21+
on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`. An
22+
ellipsis (`...`) can be use to represent all other dimensions:
2223

2324
.. ipython:: python
2425
2526
ds = xr.Dataset({'foo': (('x', 'y', 'z'), [[[42]]]), 'bar': (('y', 'z'), [[24]])})
2627
ds.transpose('y', 'z', 'x')
28+
ds.transpose(..., 'x') # equivalent
2729
ds.transpose() # reverses all dimensions
2830
2931
Expand and squeeze dimensions

doc/whats-new.rst

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,23 @@ Breaking changes
2222
~~~~~~~~~~~~~~~~
2323

2424
- Minimum cftime version is now 1.0.3. By `Deepak Cherian <https://github.com/dcherian>`_.
25+
- All leftover support for dates from non-standard calendars through netcdftime, the
26+
module included in versions of netCDF4 prior to 1.4 that eventually became the
27+
cftime package, has been removed in favor of relying solely on the standalone
28+
cftime package (:pull:`3450`). By `Spencer Clark
29+
<https://github.com/spencerkclark>`_.
2530

2631
New Features
2732
~~~~~~~~~~~~
33+
- :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)
34+
to represent all 'other' dimensions. For example, to move one dimension to the front,
35+
use `.transpose('x', ...)`. (:pull:`3421`)
36+
By `Maximilian Roos <https://github.com/max-sixty>`_
37+
- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use
38+
`...` directly. As before, you can use this to instruct a `groupby` operation
39+
to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest
40+
using `...`.
41+
By `Maximilian Roos <https://github.com/max-sixty>`_
2842
- Added integration tests against `pint <https://pint.readthedocs.io/>`_.
2943
(:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.
3044

@@ -36,14 +50,23 @@ New Features
3650
``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.
3751
Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.
3852

53+
- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve
54+
representation of objects in jupyter. By default this feature is turned off
55+
for now. Enable it with :py:meth:`xarray.set_options(display_style="html")`.
56+
(:pull:`3425`) by `Benoit Bovy <https://github.com/benbovy>`_ and
57+
`Julia Signell <https://github.com/jsignell>`_.
58+
3959
Bug fixes
4060
~~~~~~~~~
4161
- Fix regression introduced in v0.14.0 that would cause a crash if dask is installed
4262
but cloudpickle isn't (:issue:`3401`) by `Rhys Doyle <https://github.com/rdoyle45>`_
43-
44-
- Sync with cftime by removing `dayofwk=-1` for cftime>=1.0.4.
63+
- Fix grouping over variables with NaNs. (:issue:`2383`, :pull:`3406`).
64+
By `Deepak Cherian <https://github.com/dcherian>`_.
65+
- Sync with cftime by removing `dayofwk=-1` for cftime>=1.0.4.
4566
By `Anderson Banihirwe <https://github.com/andersy005>`_.
46-
67+
- Fix :py:meth:`xarray.core.groupby.DataArrayGroupBy.reduce` and
68+
:py:meth:`xarray.core.groupby.DatasetGroupBy.reduce` when reducing over multiple dimensions.
69+
(:issue:`3402`). By `Deepak Cherian <https://github.com/dcherian/>`_
4770

4871
Documentation
4972
~~~~~~~~~~~~~

0 commit comments

Comments
 (0)