Skip to content

Commit ac7aeeb

Browse files
committed
Merge remote-tracking branch 'upstream/master' into interp-na-maxgap
* upstream/master: __dask_tokenize__ (pydata#3446) Type check sentinel values (pydata#3472) Fix typo in docstring (pydata#3474) fix test suite warnings re `drop` (pydata#3460) Fix integrate docs (pydata#3469) Fix leap year condition in monthly means example (pydata#3464) Hypothesis tests for roundtrip to & from pandas (pydata#3285) unpin cftime (pydata#3463) Cleanup whatsnew (pydata#3462) enable xr.ALL_DIMS in xr.dot (pydata#3424) Merge stable into master (pydata#3457) 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)
2 parents cb3a3f1 + 53c5199 commit ac7aeeb

Some content is hidden

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

45 files changed

+1207
-388
lines changed

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.

ci/requirements/py36-min-all-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- cartopy=0.17
1414
- cdms2=3.1
1515
- cfgrib=0.9
16-
- cftime=1.0.3 # FIXME need 1.0.5 (not released yet); 1.0.4 is broken
16+
- cftime=1.0
1717
- coveralls
1818
- dask=1.2
1919
- distributed=1.27

ci/requirements/py36.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- cartopy
1010
- cdms2
1111
- cfgrib
12-
- cftime<1.0.4 # FIXME need 1.0.5 (not released yet); 1.0.4 is broken
12+
- cftime
1313
- coveralls
1414
- dask
1515
- distributed

ci/requirements/py37-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- cartopy
1010
# - cdms2 # Not available on Windows
1111
# - cfgrib # Causes Python interpreter crash on Windows
12-
- cftime<1.0.4 # FIXME need 1.0.5 (not released yet); 1.0.4 is broken
12+
- cftime
1313
- coveralls
1414
- dask
1515
- distributed

ci/requirements/py37.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- cartopy
1010
- cdms2
1111
- cfgrib
12-
- cftime<1.0.4 # FIXME need 1.0.5 (not released yet); 1.0.4 is broken
12+
- cftime
1313
- coveralls
1414
- dask
1515
- distributed

doc/data-structures.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Any variables using that dimension are dropped:
411411
412412
As an alternate to dictionary-like modifications, you can use
413413
:py:meth:`~xarray.Dataset.assign` and :py:meth:`~xarray.Dataset.assign_coords`.
414-
These methods return a new dataset with additional (or replaced) or values:
414+
These methods return a new dataset with additional (or replaced) values:
415415

416416
.. ipython:: python
417417
@@ -420,7 +420,7 @@ These methods return a new dataset with additional (or replaced) or values:
420420
There is also the :py:meth:`~xarray.Dataset.pipe` method that allows you to use
421421
a method call with an external function (e.g., ``ds.pipe(func)``) instead of
422422
simply calling it (e.g., ``func(ds)``). This allows you to write pipelines for
423-
transforming you data (using "method chaining") instead of writing hard to
423+
transforming your data (using "method chaining") instead of writing hard to
424424
follow nested function calls:
425425

426426
.. ipython:: python

doc/examples/monthly-means.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ the ``calendar.month_range`` function.
8383
8484
for i, (month, year) in enumerate(zip(time.month, time.year)):
8585
month_length[i] = cal_days[month]
86-
if leap_year(year, calendar=calendar):
86+
if leap_year(year, calendar=calendar) and month == 2:
8787
month_length[i] += 1
8888
return month_length
8989

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/terminology.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Terminology
1515

1616
----
1717

18-
**Variable:** A `NetCDF-like variable <https://www.unidata.ucar.edu/software/netcdf/netcdf/Variables.html>`_ consisting of dimensions, data, and attributes which describe a single array. The main functional difference between variables and numpy arrays is that numerical operations on variables implement array broadcasting by dimension name. Each ``DataArray`` has an underlying variable that can be accessed via ``arr.variable``. However, a variable is not fully described outside of either a ``Dataset`` or a ``DataArray``.
18+
**Variable:** A `NetCDF-like variable <https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_data_set_components.html#variables>`_ consisting of dimensions, data, and attributes which describe a single array. The main functional difference between variables and numpy arrays is that numerical operations on variables implement array broadcasting by dimension name. Each ``DataArray`` has an underlying variable that can be accessed via ``arr.variable``. However, a variable is not fully described outside of either a ``Dataset`` or a ``DataArray``.
1919

2020
.. note::
2121

@@ -39,4 +39,4 @@ Terminology
3939

4040
----
4141

42-
**Index:** An *index* is a data structure optimized for efficient selecting and slicing of an associated array. Xarray creates indexes for dimension coordinates so that operations along dimensions are fast, while non-dimension coordinates are not indexed. Under the hood, indexes are implemented as :py:class:`pandas.Index` objects. The index associated with dimension name ``x`` can be retrieved by ``arr.indexes[x]``. By construction, ``len(arr.dims) == len(arr.indexes)``
42+
**Index:** An *index* is a data structure optimized for efficient selecting and slicing of an associated array. Xarray creates indexes for dimension coordinates so that operations along dimensions are fast, while non-dimension coordinates are not indexed. Under the hood, indexes are implemented as :py:class:`pandas.Index` objects. The index associated with dimension name ``x`` can be retrieved by ``arr.indexes[x]``. By construction, ``len(arr.dims) == len(arr.indexes)``

doc/whats-new.rst

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,60 +21,96 @@ v0.14.1 (unreleased)
2121
Breaking changes
2222
~~~~~~~~~~~~~~~~
2323

24-
- Minimum cftime version is now 1.0.3. By `Deepak Cherian <https://github.com/dcherian>`_.
24+
- Broken compatibility with cftime < 1.0.3.
25+
By `Deepak Cherian <https://github.com/dcherian>`_.
26+
27+
.. note::
28+
29+
cftime version 1.0.4 is broken
30+
(`cftime/126 <https://github.com/Unidata/cftime/issues/126>`_);
31+
please use version 1.0.4.2 instead.
32+
33+
- All leftover support for dates from non-standard calendars through netcdftime, the
34+
module included in versions of netCDF4 prior to 1.4 that eventually became the
35+
cftime package, has been removed in favor of relying solely on the standalone
36+
cftime package (:pull:`3450`).
37+
By `Spencer Clark <https://github.com/spencerkclark>`_.
2538

2639
New Features
2740
~~~~~~~~~~~~
2841
- Added the ``max_gap`` kwarg to :py:meth:`~xarray.DataArray.interpolate_na` and
2942
:py:meth:`~xarray.Dataset.interpolate_na`. This controls the maximum size of the data
3043
gap that will be filled by interpolation. By `Deepak Cherian <https://github.com/dcherian>`_.
44+
- :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)
45+
to represent all 'other' dimensions. For example, to move one dimension to the front,
46+
use `.transpose('x', ...)`. (:pull:`3421`)
47+
By `Maximilian Roos <https://github.com/max-sixty>`_
3148
- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use
3249
`...` directly. As before, you can use this to instruct a `groupby` operation
3350
to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest
34-
using `...`.
51+
using `...`. (:pull:`3418`)
3552
By `Maximilian Roos <https://github.com/max-sixty>`_
36-
- Added integration tests against `pint <https://pint.readthedocs.io/>`_.
37-
(:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.
38-
39-
.. note::
40-
41-
At the moment of writing, these tests *as well as the ability to use pint in general*
42-
require `a highly experimental version of pint
43-
<https://github.com/andrewgsavage/pint/pull/6>`_ (install with
44-
``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.
45-
Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.
46-
53+
- :py:func:`~xarray.dot`, and :py:func:`~xarray.DataArray.dot` now support the
54+
`dims=...` option to sum over the union of dimensions of all input arrays
55+
(:issue:`3423`) by `Mathias Hauser <https://github.com/mathause>`_.
4756
- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve
4857
representation of objects in jupyter. By default this feature is turned off
4958
for now. Enable it with :py:meth:`xarray.set_options(display_style="html")`.
5059
(:pull:`3425`) by `Benoit Bovy <https://github.com/benbovy>`_ and
5160
`Julia Signell <https://github.com/jsignell>`_.
61+
- Implement `dask deterministic hashing
62+
<https://docs.dask.org/en/latest/custom-collections.html#deterministic-hashing>`_
63+
for xarray objects. Note that xarray objects with a dask.array backend already used
64+
deterministic hashing in previous releases; this change implements it when whole
65+
xarray objects are embedded in a dask graph, e.g. when :meth:`DataArray.map` is
66+
invoked. (:issue:`3378`, :pull:`3446`)
67+
By `Deepak Cherian <https://github.com/dcherian>`_ and
68+
`Guido Imperiale <https://github.com/crusaderky>`_.
5269

5370
Bug fixes
5471
~~~~~~~~~
5572
- Fix regression introduced in v0.14.0 that would cause a crash if dask is installed
5673
but cloudpickle isn't (:issue:`3401`) by `Rhys Doyle <https://github.com/rdoyle45>`_
57-
58-
- Sync with cftime by removing `dayofwk=-1` for cftime>=1.0.4.
74+
- Fix grouping over variables with NaNs. (:issue:`2383`, :pull:`3406`).
75+
By `Deepak Cherian <https://github.com/dcherian>`_.
76+
- Sync with cftime by removing `dayofwk=-1` for cftime>=1.0.4.
5977
By `Anderson Banihirwe <https://github.com/andersy005>`_.
60-
78+
- Fix :py:meth:`xarray.core.groupby.DataArrayGroupBy.reduce` and
79+
:py:meth:`xarray.core.groupby.DatasetGroupBy.reduce` when reducing over multiple dimensions.
80+
(:issue:`3402`). By `Deepak Cherian <https://github.com/dcherian/>`_
6181

6282
Documentation
6383
~~~~~~~~~~~~~
64-
84+
- Fix leap year condition in example (http://xarray.pydata.org/en/stable/examples/monthly-means.html) by `Mickaël Lalande <https://github.com/mickaellalande>`_.
6585
- Fix the documentation of :py:meth:`DataArray.resample` and
6686
:py:meth:`Dataset.resample` and explicitly state that a
6787
datetime-like dimension is required. (:pull:`3400`)
6888
By `Justus Magin <https://github.com/keewis>`_.
6989
- Update the terminology page to address multidimensional coordinates. (:pull:`3410`)
7090
By `Jon Thielen <https://github.com/jthielen>`_.
91+
- Fix the documentation of :py:meth:`Dataset.integrate` and
92+
:py:meth:`DataArray.integrate` and add an example to
93+
:py:meth:`Dataset.integrate`. (:pull:`3469`)
94+
By `Justus Magin <https://github.com/keewis>`_.
7195

7296
Internal Changes
7397
~~~~~~~~~~~~~~~~
7498

99+
- Added integration tests against `pint <https://pint.readthedocs.io/>`_.
100+
(:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.
101+
102+
.. note::
103+
104+
At the moment of writing, these tests *as well as the ability to use pint in general*
105+
require `a highly experimental version of pint
106+
<https://github.com/andrewgsavage/pint/pull/6>`_ (install with
107+
``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.
108+
Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.
109+
75110
- Use Python 3.6 idioms throughout the codebase. (:pull:3419)
76111
By `Maximilian Roos <https://github.com/max-sixty>`_
77112

113+
78114
.. _whats-new.0.14.0:
79115

80116
v0.14.0 (14 Oct 2019)

0 commit comments

Comments
 (0)