Skip to content

Commit 6e4c11f

Browse files
authored
Merge branch 'master' into fix/dask-computes
2 parents 08f7f74 + 53c5199 commit 6e4c11f

21 files changed

+400
-78
lines changed

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/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: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@ 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+
2533
- All leftover support for dates from non-standard calendars through netcdftime, the
2634
module included in versions of netCDF4 prior to 1.4 that eventually became the
2735
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>`_.
36+
cftime package (:pull:`3450`).
37+
By `Spencer Clark <https://github.com/spencerkclark>`_.
3038

3139
New Features
3240
~~~~~~~~~~~~
@@ -37,24 +45,24 @@ New Features
3745
- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use
3846
`...` directly. As before, you can use this to instruct a `groupby` operation
3947
to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest
40-
using `...`.
48+
using `...`. (:pull:`3418`)
4149
By `Maximilian Roos <https://github.com/max-sixty>`_
42-
- Added integration tests against `pint <https://pint.readthedocs.io/>`_.
43-
(:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.
44-
45-
.. note::
46-
47-
At the moment of writing, these tests *as well as the ability to use pint in general*
48-
require `a highly experimental version of pint
49-
<https://github.com/andrewgsavage/pint/pull/6>`_ (install with
50-
``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.
51-
Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.
52-
50+
- :py:func:`~xarray.dot`, and :py:func:`~xarray.DataArray.dot` now support the
51+
`dims=...` option to sum over the union of dimensions of all input arrays
52+
(:issue:`3423`) by `Mathias Hauser <https://github.com/mathause>`_.
5353
- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve
5454
representation of objects in jupyter. By default this feature is turned off
5555
for now. Enable it with :py:meth:`xarray.set_options(display_style="html")`.
5656
(:pull:`3425`) by `Benoit Bovy <https://github.com/benbovy>`_ and
5757
`Julia Signell <https://github.com/jsignell>`_.
58+
- Implement `dask deterministic hashing
59+
<https://docs.dask.org/en/latest/custom-collections.html#deterministic-hashing>`_
60+
for xarray objects. Note that xarray objects with a dask.array backend already used
61+
deterministic hashing in previous releases; this change implements it when whole
62+
xarray objects are embedded in a dask graph, e.g. when :meth:`DataArray.map` is
63+
invoked. (:issue:`3378`, :pull:`3446`)
64+
By `Deepak Cherian <https://github.com/dcherian>`_ and
65+
`Guido Imperiale <https://github.com/crusaderky>`_.
5866

5967
Bug fixes
6068
~~~~~~~~~
@@ -73,20 +81,36 @@ Bug fixes
7381

7482
Documentation
7583
~~~~~~~~~~~~~
76-
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>`_.
7785
- Fix the documentation of :py:meth:`DataArray.resample` and
7886
:py:meth:`Dataset.resample` and explicitly state that a
7987
datetime-like dimension is required. (:pull:`3400`)
8088
By `Justus Magin <https://github.com/keewis>`_.
8189
- Update the terminology page to address multidimensional coordinates. (:pull:`3410`)
8290
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>`_.
8395

8496
Internal Changes
8597
~~~~~~~~~~~~~~~~
8698

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+
87110
- Use Python 3.6 idioms throughout the codebase. (:pull:3419)
88111
By `Maximilian Roos <https://github.com/max-sixty>`_
89112

113+
90114
.. _whats-new.0.14.0:
91115

92116
v0.14.0 (14 Oct 2019)

properties/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
try:
2+
from hypothesis import settings
3+
except ImportError:
4+
pass
5+
else:
6+
# Run for a while - arrays are a bigger search space than usual
7+
settings.register_profile("ci", deadline=None, print_blob=True)
8+
settings.load_profile("ci")

properties/test_encode_decode.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@
1010

1111
import hypothesis.extra.numpy as npst
1212
import hypothesis.strategies as st
13-
from hypothesis import given, settings
13+
from hypothesis import given
1414

1515
import xarray as xr
1616

17-
# Run for a while - arrays are a bigger search space than usual
18-
settings.register_profile("ci", deadline=None)
19-
settings.load_profile("ci")
20-
21-
2217
an_array = npst.arrays(
2318
dtype=st.one_of(
2419
npst.unsigned_integer_dtypes(), npst.integer_dtypes(), npst.floating_dtypes()

0 commit comments

Comments
 (0)