Skip to content

Commit 1f998f0

Browse files
committed
Merge branch 'propagate-attrs' of github.com:dcherian/xarray into propagate-attrs
* 'propagate-attrs' of github.com:dcherian/xarray: (22 commits) silence sphinx warnings about broken rst (pydata#4448) Xarray open_mfdataset with engine Zarr (pydata#4187) Fix release notes formatting (pydata#4443) fix typo in io.rst (pydata#4250) Fix typo (pydata#4181) Fix release notes typo New whatsnew section Add notes re doctests (pydata#4440) Fixed dask.optimize on datasets (pydata#4438) Release notes for 0.16.1 (pydata#4435) Small updates to How-to-release + lint (pydata#4436) Fix doctests (pydata#4439) add a ci for doctests (pydata#4437) preserve original dimension, coordinate and variable order in ``concat`` (pydata#4419) Fix for h5py deepcopy issues (pydata#4426) Keep the original ordering of the coordinates (pydata#4409) Clearer Vectorized Indexing example (pydata#4433) Revert "Fix optimize for chunked DataArray (pydata#4432)" (pydata#4434) Fix optimize for chunked DataArray (pydata#4432) fix doc dataarray to netcdf (pydata#4424) ...
2 parents 12bfec7 + cc2d385 commit 1f998f0

27 files changed

+466
-247
lines changed

HOW_TO_RELEASE.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,34 @@
33
Time required: about an hour.
44

55
These instructions assume that `upstream` refers to the main repository:
6-
```
6+
7+
```sh
78
$ git remote -v
89
{...}
910
upstream https://github.com/pydata/xarray (fetch)
1011
upstream https://github.com/pydata/xarray (push)
1112
```
1213

14+
<!-- markdownlint-disable MD031 -->
15+
1316
1. Ensure your master branch is synced to upstream:
1417
```sh
1518
git pull upstream master
1619
```
17-
2. Get a list of contributors with:
20+
2. Add a list of contributors with:
1821
```sh
1922
git log "$(git tag --sort="v:refname" | sed -n 'x;$p').." --format=%aN | sort -u | perl -pe 's/\n/$1, /'
2023
```
2124
or by substituting the _previous_ release in {0.X.Y-1}:
2225
```sh
2326
git log v{0.X.Y-1}.. --format=%aN | sort -u | perl -pe 's/\n/$1, /'
2427
```
25-
Add these into `whats-new.rst` somewhere :)
28+
This will return the number of contributors:
29+
```sh
30+
git log v{0.X.Y-1}.. --format=%aN | sort -u | wc -l
31+
```
2632
3. Write a release summary: ~50 words describing the high level features. This
27-
will be used in the release emails, tweets, GitHub release notes, etc.
33+
will be used in the release emails, tweets, GitHub release notes, etc.
2834
4. Look over whats-new.rst and the docs. Make sure "What's New" is complete
2935
(check the date!) and add the release summary at the top.
3036
Things to watch out for:
@@ -45,7 +51,7 @@ upstream https://github.com/pydata/xarray (push)
4551
```
4652
8. Check that the ReadTheDocs build is passing.
4753
9. On the master branch, commit the release in git:
48-
```s
54+
```sh
4955
git commit -am 'Release v{0.X.Y}'
5056
```
5157
10. Tag the release:
@@ -67,7 +73,7 @@ upstream https://github.com/pydata/xarray (push)
6773
twine upload dist/xarray-{0.X.Y}*
6874
```
6975
You will need to be listed as a package owner at
70-
https://pypi.python.org/pypi/xarray for this to work.
76+
<https://pypi.python.org/pypi/xarray> for this to work.
7177
14. Push your changes to master:
7278
```sh
7379
git push upstream master
@@ -80,11 +86,11 @@ upstream https://github.com/pydata/xarray (push)
8086
git push --force upstream stable
8187
git checkout master
8288
```
83-
It's OK to force push to 'stable' if necessary. (We also update the stable
84-
branch with `git cherry-pick` for documentation only fixes that apply the
89+
It's OK to force push to 'stable' if necessary. (We also update the stable
90+
branch with `git cherry-pick` for documentation only fixes that apply the
8591
current released version.)
8692
16. Add a section for the next release {0.X.Y+1} to doc/whats-new.rst:
87-
```
93+
```rst
8894
.. _whats-new.{0.X.Y+1}:
8995
9096
v{0.X.Y+1} (unreleased)
@@ -116,12 +122,12 @@ upstream https://github.com/pydata/xarray (push)
116122
```
117123
You're done pushing to master!
118124
18. Issue the release on GitHub. Click on "Draft a new release" at
119-
https://github.com/pydata/xarray/releases. Type in the version number
125+
<https://github.com/pydata/xarray/releases>. Type in the version number
120126
and paste the release summary in the notes.
121-
19. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
127+
19. Update the docs. Login to <https://readthedocs.org/projects/xray/versions/>
122128
and switch your new release tag (at the bottom) from "Inactive" to "Active".
123129
It should now build automatically.
124-
20. Issue the release announcement to mailing lists & Twitter. For bug fix releases, I
130+
20. Issue the release announcement to mailing lists & Twitter. For bug fix releases, I
125131
usually only email [email protected]. For major/feature releases, I will email a broader
126132
list (no more than once every 3-6 months):
127133
@@ -133,6 +139,8 @@ upstream https://github.com/pydata/xarray (push)
133139
Google search will turn up examples of prior release announcements (look for
134140
"ANN xarray").
135141
142+
<!-- markdownlint-enable MD013 -->
143+
136144
## Note on version numbering
137145
138146
We follow a rough approximation of semantic version. Only major releases (0.X.0)

azure-pipelines.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ jobs:
7474
- bash: black --check .
7575
displayName: black formatting check
7676

77+
- job: Doctests
78+
variables:
79+
conda_env: py38
80+
pool:
81+
vmImage: 'ubuntu-16.04'
82+
steps:
83+
- template: ci/azure/install.yml
84+
- bash: |
85+
source activate xarray-tests
86+
python -m pytest --doctest-modules xarray --ignore xarray/tests
87+
displayName: Run doctests
88+
7789
- job: TypeChecking
7890
variables:
7991
conda_env: py38

ci/requirements/doc.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ dependencies:
1818
- netcdf4>=1.5
1919
- numba
2020
- numpy>=1.17
21-
# FIXME https://github.com/pydata/xarray/issues/4287
22-
# - pandas>=1.0
23-
- pandas=1.0
21+
- pandas>=1.0
2422
- rasterio>=1.1
2523
- seaborn
2624
- setuptools

ci/requirements/py36-min-nep18.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
- distributed=2.9
1111
- numpy=1.17
1212
- pandas=0.25
13-
- pint=0.13
13+
- pint=0.15
1414
- pip
1515
- pytest
1616
- pytest-cov

doc/indexing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ MATLAB, or after using the :py:func:`numpy.ix_` helper:
339339
coords={"x": [0, 1, 2], "y": ["a", "b", "c", "d"]},
340340
)
341341
da
342-
da[[0, 1], [1, 1]]
342+
da[[0, 2, 2], [1, 3]]
343343
344344
For more flexibility, you can supply :py:meth:`~xarray.DataArray` objects
345345
as indexers.

doc/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The recommended way to store xarray data structures is `netCDF`__, which
2626
is a binary file format for self-described datasets that originated
2727
in the geosciences. xarray is based on the netCDF data model, so netCDF files
2828
on disk directly correspond to :py:class:`Dataset` objects (more accurately,
29-
a group in a netCDF file directly corresponds to a to :py:class:`Dataset` object.
29+
a group in a netCDF file directly corresponds to a :py:class:`Dataset` object.
3030
See :ref:`io.netcdf_groups` for more.)
3131

3232
NetCDF is supported on almost all platforms, and parsers exist

doc/quick-overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Here are the key properties for a ``DataArray``:
4646
Indexing
4747
--------
4848

49-
xarray supports four kind of indexing. Since we have assigned coordinate labels to the x dimension we can use label-based indexing along that dimension just like pandas. The four examples below all yield the same result (the value at `x=10`) but at varying levels of convenience and intuitiveness.
49+
xarray supports four kinds of indexing. Since we have assigned coordinate labels to the x dimension we can use label-based indexing along that dimension just like pandas. The four examples below all yield the same result (the value at `x=10`) but at varying levels of convenience and intuitiveness.
5050

5151
.. ipython:: python
5252

doc/related-projects.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Other domains
5858
~~~~~~~~~~~~~
5959
- `ptsa <https://pennmem.github.io/ptsa_new/html/index.html>`_: EEG Time Series Analysis
6060
- `pycalphad <https://pycalphad.org/docs/latest/>`_: Computational Thermodynamics in Python
61+
- `pyomeca <https://pyomeca.github.io/>`_: Python framework for biomechanical analysis
6162

6263
Extend xarray capabilities
6364
~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/whats-new.rst

Lines changed: 96 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,62 +14,107 @@ What's New
1414
1515
np.random.seed(123456)
1616
17+
18+
.. _whats-new.0.16.2:
19+
20+
v0.16.2 (unreleased)
21+
--------------------
22+
23+
Breaking changes
24+
~~~~~~~~~~~~~~~~
25+
26+
27+
New Features
28+
~~~~~~~~~~~~
29+
30+
- :py:func:`open_dataset` and :py:func:`open_mfdataset`
31+
now works with ``engine="zarr"`` (:issue:`3668`, :pull:`4003`, :pull:`4187`).
32+
By `Miguel Jimenez <https://github.com/Mikejmnez>`_ and `Wei Ji Leong <https://github.com/weiji14>`_.
33+
- Unary & binary operations follow the ``keep_attrs`` flag (:issue:`3490`, :issue:`4065`, :issue:`3433`, :issue:`3595`, :pull:`4195`).
34+
By `Deepak Cherian <https://github.com/dcherian>`_.
35+
36+
Bug fixes
37+
~~~~~~~~~
38+
39+
40+
Documentation
41+
~~~~~~~~~~~~~
42+
43+
44+
Internal Changes
45+
~~~~~~~~~~~~~~~~
46+
47+
1748
.. _whats-new.0.16.1:
1849

19-
v0.16.1 (unreleased)
50+
v0.16.1 (2020-09-20)
2051
---------------------
2152

53+
This patch release fixes an incompatibility with a recent pandas change, which
54+
was causing an issue indexing with a ``datetime64``. It also includes
55+
improvements to ``rolling``, ``to_dataframe``, ``cov`` & ``corr`` methods and
56+
bug fixes. Our documentation has a number of improvements, including fixing all
57+
doctests and confirming their accuracy on every commit.
58+
59+
Many thanks to the 36 contributors who contributed to this release:
60+
61+
Aaron Spring, Akio Taniguchi, Aleksandar Jelenak, Alexandre Poux,
62+
Caleb, Dan Nowacki, Deepak Cherian, Gerardo Rivera, Jacob Tomlinson, James A.
63+
Bednar, Joe Hamman, Julia Kent, Kai Mühlbauer, Keisuke Fujii, Mathias Hauser,
64+
Maximilian Roos, Nick R. Papior, Pascal Bourgault, Peter Hausamann, Romain
65+
Martinez, Russell Manser, Samnan Rahee, Sander, Spencer Clark, Stephan Hoyer,
66+
Thomas Zilio, Tobias Kölling, Tom Augspurger, alexamici, crusaderky, darikg,
67+
inakleinbottle, jenssss, johnomotani, keewis, and rpgoldman.
68+
2269
Breaking changes
2370
~~~~~~~~~~~~~~~~
71+
2472
- :py:meth:`DataArray.astype` and :py:meth:`Dataset.astype` now preserve attributes. Keep the
2573
old behavior by passing `keep_attrs=False` (:issue:`2049`, :pull:`4314`).
2674
By `Dan Nowacki <https://github.com/dnowacki-usgs>`_ and `Gabriel Joel Mitchell <https://github.com/gajomi>`_.
2775

2876
New Features
2977
~~~~~~~~~~~~
30-
- Support multiple outputs in :py:func:`xarray.apply_ufunc` when using ``dask='parallelized'``. (:issue:`1815`, :pull:`4060`)
31-
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
78+
3279
- :py:meth:`~xarray.DataArray.rolling` and :py:meth:`~xarray.Dataset.rolling`
3380
now accept more than 1 dimension. (:pull:`4219`)
3481
By `Keisuke Fujii <https://github.com/fujiisoup>`_.
82+
- :py:meth:`~xarray.DataArray.to_dataframe` and :py:meth:`~xarray.Dataset.to_dataframe`
83+
now accept a ``dim_order`` parameter allowing to specify the resulting dataframe's
84+
dimensions order (:issue:`4331`, :pull:`4333`).
85+
By `Thomas Zilio <https://github.com/thomas-z>`_.
86+
- Support multiple outputs in :py:func:`xarray.apply_ufunc` when using
87+
``dask='parallelized'``. (:issue:`1815`, :pull:`4060`).
88+
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
3589
- ``min_count`` can be supplied to reductions such as ``.sum`` when specifying
36-
multiple dimension to reduce over. (:pull:`4356`)
90+
multiple dimension to reduce over; (:pull:`4356`).
3791
By `Maximilian Roos <https://github.com/max-sixty>`_.
38-
- :py:func:`xarray.cov` and :py:func:`xarray.corr` now handle missing values. (:pull:`4351`)
92+
- :py:func:`xarray.cov` and :py:func:`xarray.corr` now handle missing values; (:pull:`4351`).
3993
By `Maximilian Roos <https://github.com/max-sixty>`_.
94+
- Add support for parsing datetime strings formatted following the default
95+
string representation of cftime objects, i.e. YYYY-MM-DD hh:mm:ss, in
96+
partial datetime string indexing, as well as :py:meth:`~xarray.cftime_range`
97+
(:issue:`4337`). By `Spencer Clark <https://github.com/spencerkclark>`_.
4098
- Build ``CFTimeIndex.__repr__`` explicitly as :py:class:`pandas.Index`. Add ``calendar`` as a new
4199
property for :py:class:`CFTimeIndex` and show ``calendar`` and ``length`` in
42100
``CFTimeIndex.__repr__`` (:issue:`2416`, :pull:`4092`)
43101
By `Aaron Spring <https://github.com/aaronspring>`_.
44-
- Relaxed the :ref:`mindeps_policy` to support:
45-
46-
- all versions of setuptools released in the last 42 months (but no older than 38.4)
47-
- all versions of dask and dask.distributed released in the last 12 months (but no
48-
older than 2.9)
49-
- all versions of other packages released in the last 12 months
50-
51-
All are up from 6 months (:issue:`4295`)
52-
`Guido Imperiale <https://github.com/crusaderky>`_.
53102
- Use a wrapped array's ``_repr_inline_`` method to construct the collapsed ``repr``
54103
of :py:class:`DataArray` and :py:class:`Dataset` objects and
55104
document the new method in :doc:`internals`. (:pull:`4248`).
56105
By `Justus Magin <https://github.com/keewis>`_.
57-
- Unary & binary operations follow the ``keep_attrs`` flag (:issue:`3490`, :issue:`4065`, :issue:`3433`, :issue:`3595`, :pull:`4195`).
58-
By `Deepak Cherian <https://github.com/dcherian>`_.
59-
- Add support for parsing datetime strings formatted following the default
60-
string representation of cftime objects, i.e. YYYY-MM-DD hh:mm:ss, in
61-
partial datetime string indexing, as well as :py:meth:`~xarray.cftime_range`
62-
(:issue:`4337`). By `Spencer Clark <https://github.com/spencerkclark>`_.
63-
- :py:meth:`~xarray.DataArray.to_dataframe` and :py:meth:`~xarray.Dataset.to_dataframe`
64-
now accept a ``dim_order`` parameter allowing to specify the resulting dataframe's
65-
dimensions order (:issue:`4331`, :pull:`4333`).
66-
By `Thomas Zilio <https://github.com/thomas-z>`_.
106+
- Allow per-variable fill values in most functions. (:pull:`4237`).
107+
By `Justus Magin <https://github.com/keewis>`_.
67108
- Expose ``use_cftime`` option in :py:func:`~xarray.open_zarr` (:issue:`2886`, :pull:`3229`)
68109
By `Samnan Rahee <https://github.com/Geektrovert>`_ and `Anderson Banihirwe <https://github.com/andersy005>`_.
69110

70111

71112
Bug fixes
72113
~~~~~~~~~
114+
115+
- Fix indexing with datetime64 scalars with pandas 1.1 (:issue:`4283`).
116+
By `Stephan Hoyer <https://github.com/shoyer>`_ and
117+
`Justus Magin <https://github.com/keewis>`_.
73118
- Variables which are chunked using dask only along some dimensions can be chunked while storing with zarr along previously
74119
unchunked dimensions (:pull:`4312`) By `Tobias Kölling <https://github.com/d70-t>`_.
75120
- Fixed a bug in backend caused by basic installation of Dask (:issue:`4164`, :pull:`4318`)
@@ -79,7 +124,7 @@ Bug fixes
79124
and :py:meth:`DataArray.str.wrap` (:issue:`4334`). By `Mathias Hauser <https://github.com/mathause>`_.
80125
- Fixed overflow issue causing incorrect results in computing means of :py:class:`cftime.datetime`
81126
arrays (:issue:`4341`). By `Spencer Clark <https://github.com/spencerkclark>`_.
82-
- Fixed :py:meth:`Dataset.coarsen`, :py:meth:`DataArray.coarsen` dropping attributes on original object (:issue:`4120`, :pull:`4360`). by `Julia Kent <https://github.com/jukent>`_.
127+
- Fixed :py:meth:`Dataset.coarsen`, :py:meth:`DataArray.coarsen` dropping attributes on original object (:issue:`4120`, :pull:`4360`). By `Julia Kent <https://github.com/jukent>`_.
83128
- fix the signature of the plot methods. (:pull:`4359`) By `Justus Magin <https://github.com/keewis>`_.
84129
- Fix :py:func:`xarray.apply_ufunc` with ``vectorize=True`` and ``exclude_dims`` (:issue:`3890`).
85130
By `Mathias Hauser <https://github.com/mathause>`_.
@@ -88,6 +133,15 @@ Bug fixes
88133
By `Jens Svensmark <https://github.com/jenssss>`_
89134
- Fix incorrect legend labels for :py:meth:`Dataset.plot.scatter` (:issue:`4126`).
90135
By `Peter Hausamann <https://github.com/phausamann>`_.
136+
- Fix ``dask.optimize`` on ``DataArray`` producing an invalid Dask task graph (:issue:`3698`)
137+
By `Tom Augspurger <https://github.com/TomAugspurger>`_
138+
- Fix ``pip install .`` when no ``.git`` directory exists; namely when the xarray source
139+
directory has been rsync'ed by PyCharm Professional for a remote deployment over SSH.
140+
By `Guido Imperiale <https://github.com/crusaderky>`_
141+
- Preserve dimension and coordinate order during :py:func:`xarray.concat` (:issue:`2811`, :issue:`4072`, :pull:`4419`).
142+
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
143+
- Avoid relying on :py:class:`set` objects for the ordering of the coordinates (:pull:`4409`)
144+
By `Justus Magin <https://github.com/keewis>`_.
91145

92146
Documentation
93147
~~~~~~~~~~~~~
@@ -97,15 +151,28 @@ Documentation
97151
- Removed skipna argument from :py:meth:`DataArray.count`, :py:meth:`DataArray.any`, :py:meth:`DataArray.all`. (:issue:`755`)
98152
By `Sander van Rijn <https://github.com/sjvrijn>`_
99153
- Update the contributing guide to use merges instead of rebasing and state
100-
that we squash-merge. (:pull:`4355`) By `Justus Magin <https://github.com/keewis>`_.
154+
that we squash-merge. (:pull:`4355`). By `Justus Magin <https://github.com/keewis>`_.
155+
- Make sure the examples from the docstrings actually work (:pull:`4408`).
156+
By `Justus Magin <https://github.com/keewis>`_.
157+
- Updated Vectorized Indexing to a clearer example.
158+
By `Maximilian Roos <https://github.com/max-sixty>`_
101159

102160
Internal Changes
103161
~~~~~~~~~~~~~~~~
162+
163+
- Fixed all doctests and enabled their running in CI.
164+
By `Justus Magin <https://github.com/keewis>`_.
165+
- Relaxed the :ref:`mindeps_policy` to support:
166+
167+
- all versions of setuptools released in the last 42 months (but no older than 38.4)
168+
- all versions of dask and dask.distributed released in the last 12 months (but no
169+
older than 2.9)
170+
- all versions of other packages released in the last 12 months
171+
172+
All are up from 6 months (:issue:`4295`)
173+
`Guido Imperiale <https://github.com/crusaderky>`_.
104174
- Use :py:func:`dask.array.apply_gufunc` instead of :py:func:`dask.array.blockwise` in
105175
:py:func:`xarray.apply_ufunc` when using ``dask='parallelized'``. (:pull:`4060`, :pull:`4391`, :pull:`4392`)
106-
- Fix ``pip install .`` when no ``.git`` directory exists; namely when the xarray source
107-
directory has been rsync'ed by PyCharm Professional for a remote deployment over SSH.
108-
By `Guido Imperiale <https://github.com/crusaderky>`_
109176
- Align ``mypy`` versions to ``0.782`` across ``requirements`` and
110177
``.pre-commit-config.yml`` files. (:pull:`4390`)
111178
By `Maximilian Roos <https://github.com/max-sixty>`_

0 commit comments

Comments
 (0)