Skip to content

Commit 2b39154

Browse files
committed
Merge branch 'master' into fix/4107
* master: Add initial cupy tests (pydata#4214) Add 0.16.0 release summary New whatsnew section Release v0.16.0 Minor reorg of whatsnew for 0.16.0 (pydata#4216) fix sphinx warnings (pydata#4199) pin isort (pydata#4206) get the colorbar label via public methods (pydata#4201) Bump minimum versions for 0.16 release (pydata#4175) Allow passing axis kwargs to plot (pydata#4020) Fix to_unstacked_dataset for single dimension variables. (pydata#4094) Improve the speed of from_dataframe with a MultiIndex (by 40x!) (pydata#4184) More pint compatibility: silence UnitStrippedWarnings (pydata#4163) Fix typo (pydata#4192) use the latest image of RTD (pydata#4191)
2 parents 2620ad6 + 52043bc commit 2b39154

27 files changed

+1269
-712
lines changed

asv_bench/benchmarks/pandas.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import numpy as np
2+
import pandas as pd
3+
4+
from . import parameterized
5+
6+
7+
class MultiIndexSeries:
8+
def setup(self, dtype, subset):
9+
data = np.random.rand(100000).astype(dtype)
10+
index = pd.MultiIndex.from_product(
11+
[
12+
list("abcdefhijk"),
13+
list("abcdefhijk"),
14+
pd.date_range(start="2000-01-01", periods=1000, freq="B"),
15+
]
16+
)
17+
series = pd.Series(data, index)
18+
if subset:
19+
series = series[::3]
20+
self.series = series
21+
22+
@parameterized(["dtype", "subset"], ([int, float], [True, False]))
23+
def time_to_xarray(self, dtype, subset):
24+
self.series.to_xarray()

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,21 @@ dependencies:
1515
- cfgrib=0.9
1616
- cftime=1.0
1717
- coveralls
18-
- dask=2.5
19-
- distributed=2.5
18+
- dask=2.9
19+
- distributed=2.9
2020
- flake8
2121
- h5netcdf=0.7
2222
- h5py=2.9 # Policy allows for 2.10, but it's a conflict-fest
2323
- hdf5=1.10
2424
- hypothesis
2525
- iris=2.2
26-
- isort
26+
- isort=4.3.21
2727
- lxml=4.4 # Optional dep of pydap
2828
- matplotlib=3.1
29-
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
3029
- mypy=0.761 # Must match .pre-commit-config.yaml
3130
- nc-time-axis=1.2
3231
- netcdf4=1.4
33-
- numba=0.44
32+
- numba=0.46
3433
- numpy=1.15
3534
- pandas=0.25
3635
# - pint # See py36-min-nep18.yml

ci/requirements/py36-min-nep18.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ dependencies:
66
# require drastically newer packages than everything else
77
- python=3.6
88
- coveralls
9-
- dask=2.5
10-
- distributed=2.5
11-
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
9+
- dask=2.9
10+
- distributed=2.9
1211
- numpy=1.17
1312
- pandas=0.25
13+
- pint=0.13
1414
- pip
1515
- pytest
1616
- pytest-cov
1717
- pytest-env
1818
- scipy=1.2
1919
- setuptools=41.2
2020
- sparse=0.8
21-
- pip:
22-
- pint==0.13

ci/requirements/py36.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- hdf5
2020
- hypothesis
2121
- iris
22-
- isort
22+
- isort=4.3.21
2323
- lxml # Optional dep of pydap
2424
- matplotlib
2525
- mypy=0.761 # Must match .pre-commit-config.yaml
@@ -28,6 +28,7 @@ dependencies:
2828
- numba
2929
- numpy
3030
- pandas
31+
- pint
3132
- pip
3233
- pseudonetcdf
3334
- pydap
@@ -44,4 +45,3 @@ dependencies:
4445
- zarr
4546
- pip:
4647
- numbagg
47-
- pint

ci/requirements/py37-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- hdf5
2020
- hypothesis
2121
- iris
22-
- isort
22+
- isort=4.3.21
2323
- lxml # Optional dep of pydap
2424
- matplotlib
2525
- mypy=0.761 # Must match .pre-commit-config.yaml
@@ -28,6 +28,7 @@ dependencies:
2828
- numba
2929
- numpy
3030
- pandas
31+
- pint
3132
- pip
3233
- pseudonetcdf
3334
- pydap
@@ -44,4 +45,3 @@ dependencies:
4445
- zarr
4546
- pip:
4647
- numbagg
47-
- pint

ci/requirements/py37.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- hdf5
2020
- hypothesis
2121
- iris
22-
- isort
22+
- isort=4.3.21
2323
- lxml # Optional dep of pydap
2424
- matplotlib
2525
- mypy=0.761 # Must match .pre-commit-config.yaml
@@ -28,6 +28,7 @@ dependencies:
2828
- numba
2929
- numpy
3030
- pandas
31+
- pint
3132
- pip
3233
- pseudonetcdf
3334
- pydap
@@ -44,4 +45,3 @@ dependencies:
4445
- zarr
4546
- pip:
4647
- numbagg
47-
- pint

ci/requirements/py38-all-but-dask.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- h5py
1717
- hdf5
1818
- hypothesis
19-
- isort
19+
- isort=4.3.21
2020
- lxml # Optional dep of pydap
2121
- matplotlib
2222
- mypy=0.761 # Must match .pre-commit-config.yaml
@@ -25,6 +25,7 @@ dependencies:
2525
- numba
2626
- numpy
2727
- pandas
28+
- pint
2829
- pip
2930
- pseudonetcdf
3031
- pydap
@@ -41,4 +42,3 @@ dependencies:
4142
- zarr
4243
- pip:
4344
- numbagg
44-
- pint

ci/requirements/py38.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- hdf5
2020
- hypothesis
2121
- iris
22-
- isort
22+
- isort=4.3.21
2323
- lxml # Optional dep of pydap
2424
- matplotlib
2525
- mypy=0.780 # Must match .pre-commit-config.yaml
@@ -28,6 +28,7 @@ dependencies:
2828
- numba
2929
- numpy
3030
- pandas
31+
- pint
3132
- pip
3233
- pseudonetcdf
3334
- pydap
@@ -44,4 +45,3 @@ dependencies:
4445
- zarr
4546
- pip:
4647
- numbagg
47-
- pint

doc/api.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ Computation
360360
DataArray.rolling_exp
361361
DataArray.weighted
362362
DataArray.coarsen
363-
DataArray.dt
364363
DataArray.resample
365364
DataArray.get_axis_num
366365
DataArray.diff
@@ -369,7 +368,6 @@ Computation
369368
DataArray.differentiate
370369
DataArray.integrate
371370
DataArray.polyfit
372-
DataArray.str
373371
DataArray.map_blocks
374372

375373

doc/plotting.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,12 +743,13 @@ This script will plot the air temperature on a map.
743743
744744
air = xr.tutorial.open_dataset("air_temperature").air
745745
746-
ax = plt.axes(projection=ccrs.Orthographic(-80, 35))
747-
air.isel(time=0).plot.contourf(ax=ax, transform=ccrs.PlateCarree())
748-
ax.set_global()
746+
p = air.isel(time=0).plot(
747+
subplot_kws=dict(projection=ccrs.Orthographic(-80, 35), facecolor="gray"),
748+
transform=ccrs.PlateCarree())
749+
p.axes.set_global()
749750
750751
@savefig plotting_maps_cartopy.png width=100%
751-
ax.coastlines()
752+
p.axes.coastlines()
752753
753754
When faceting on maps, the projection can be transferred to the ``plot``
754755
function using the ``subplot_kws`` keyword. The axes for the subplots created

doc/related-projects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Visualization
7676
- `Datashader <https://datashader.org>`_, `geoviews <http://geo.holoviews.org>`_, `holoviews <http://holoviews.org/>`_, : visualization packages for large data.
7777
- `hvplot <https://hvplot.pyviz.org/>`_ : A high-level plotting API for the PyData ecosystem built on HoloViews.
7878
- `psyplot <https://psyplot.readthedocs.io>`_: Interactive data visualization with python.
79-
- `xarray-leaflet <https://github.com/davidbrochart/xarray_leaflet>`_: An xarray extension for tiles map plotting based on ipyleaflet.
79+
- `xarray-leaflet <https://github.com/davidbrochart/xarray_leaflet>`_: An xarray extension for tiled map plotting based on ipyleaflet.
8080

8181
Non-Python projects
8282
~~~~~~~~~~~~~~~~~~~

doc/whats-new.rst

Lines changed: 83 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,58 @@ What's New
1414
1515
np.random.seed(123456)
1616
17+
.. _whats-new.0.16.1:
18+
19+
v0.16.1 (unreleased)
20+
---------------------
21+
22+
Breaking changes
23+
~~~~~~~~~~~~~~~~
24+
25+
26+
New Features
27+
~~~~~~~~~~~~
28+
29+
30+
Bug fixes
31+
~~~~~~~~~
32+
33+
34+
Documentation
35+
~~~~~~~~~~~~~
36+
37+
38+
Internal Changes
39+
~~~~~~~~~~~~~~~~
40+
41+
1742
.. _whats-new.0.16.0:
1843

19-
v0.16.0 (unreleased)
44+
v0.16.0 (2020-07-11)
2045
---------------------
2146

47+
This release adds `xarray.cov` & `xarray.corr` for covariance & correlation
48+
respectively; the `idxmax` & `idxmin` methods, the `polyfit` method &
49+
`xarray.polyval` for fitting polynomials, as well as a number of documentation
50+
improvements, other features, and bug fixes. Many thanks to all 44 contributors
51+
who contributed to this release:
52+
53+
Akio Taniguchi, Andrew Williams, Aurélien Ponte, Benoit Bovy, Dave Cole, David
54+
Brochart, Deepak Cherian, Elliott Sales de Andrade, Etienne Combrisson, Hossein
55+
Madadi, Huite, Joe Hamman, Kai Mühlbauer, Keisuke Fujii, Maik Riechert, Marek
56+
Jacob, Mathias Hauser, Matthieu Ancellin, Maximilian Roos, Noah D Brenowitz,
57+
Oriol Abril, Pascal Bourgault, Phillip Butcher, Prajjwal Nijhara, Ray Bell, Ryan
58+
Abernathey, Ryan May, Spencer Clark, Spencer Hill, Srijan Saurav, Stephan Hoyer,
59+
Taher Chegini, Todd, Tom Nicholas, Yohai Bar Sinai, Yunus Sevinchan,
60+
arabidopsis, aurghs, clausmichele, dmey, johnomotani, keewis, raphael dussin,
61+
risebell
62+
2263
Breaking changes
2364
~~~~~~~~~~~~~~~~
2465

66+
- Minimum supported versions for the following packages have changed: ``dask >=2.9``,
67+
``distributed>=2.9``.
68+
By `Deepak Cherian <https://github.com/dcherian>`_
2569
- ``groupby`` operations will restore coord dimension order. Pass ``restore_coord_dims=False``
2670
to revert to previous behavior.
2771
- :meth:`DataArray.transpose` will now transpose coordinates by default.
@@ -43,15 +87,6 @@ Breaking changes
4387
default (:issue:`4176`)
4488
By `Stephan Hoyer <https://github.com/shoyer>`_.
4589

46-
Enhancements
47-
~~~~~~~~~~~~
48-
- Performance improvement of :py:meth:`DataArray.interp` and :py:func:`Dataset.interp`
49-
For orthogonal linear- and nearest-neighbor interpolation, we do 1d-interpolation sequentially
50-
rather than interpolating in multidimensional space. (:issue:`2223`)
51-
By `Keisuke Fujii <https://github.com/fujiisoup>`_.
52-
- :py:meth:`DataArray.reset_index` and :py:meth:`Dataset.reset_index` now keep
53-
coordinate attributes (:pull:`4103`). By `Oriol Abril <https://github.com/OriolAbril>`_.
54-
5590
New Features
5691
~~~~~~~~~~~~
5792
- :py:meth:`DataArray.argmin` and :py:meth:`DataArray.argmax` now support
@@ -61,15 +96,19 @@ New Features
6196
(:pull:`3936`)
6297
By `John Omotani <https://github.com/johnomotani>`_, thanks to `Keisuke Fujii
6398
<https://github.com/fujiisoup>`_ for work in :pull:`1469`.
99+
- Added :py:func:`xarray.cov` and :py:func:`xarray.corr` (:issue:`3784`, :pull:`3550`, :pull:`4089`).
100+
By `Andrew Williams <https://github.com/AndrewWilliams3142>`_ and `Robin Beer <https://github.com/r-beer>`_.
101+
- Implement :py:meth:`DataArray.idxmax`, :py:meth:`DataArray.idxmin`,
102+
:py:meth:`Dataset.idxmax`, :py:meth:`Dataset.idxmin`. (:issue:`60`, :pull:`3871`)
103+
By `Todd Jennings <https://github.com/toddrjen>`_
104+
- Added :py:meth:`DataArray.polyfit` and :py:func:`xarray.polyval` for fitting
105+
polynomials. (:issue:`3349`, :pull:`3733`, :pull:`4099`)
106+
By `Pascal Bourgault <https://github.com/aulemahal>`_.
64107
- Added :py:meth:`xarray.infer_freq` for extending frequency inferring to CFTime indexes and data (:pull:`4033`).
65108
By `Pascal Bourgault <https://github.com/aulemahal>`_.
66109
- ``chunks='auto'`` is now supported in the ``chunks`` argument of
67110
:py:meth:`Dataset.chunk`. (:issue:`4055`)
68111
By `Andrew Williams <https://github.com/AndrewWilliams3142>`_
69-
- Added :py:func:`xarray.cov` and :py:func:`xarray.corr` (:issue:`3784`, :pull:`3550`, :pull:`4089`).
70-
By `Andrew Williams <https://github.com/AndrewWilliams3142>`_ and `Robin Beer <https://github.com/r-beer>`_.
71-
- Added :py:meth:`DataArray.polyfit` and :py:func:`xarray.polyval` for fitting polynomials. (:issue:`3349`, :pull:`3733`, :pull:`4099`)
72-
By `Pascal Bourgault <https://github.com/aulemahal>`_.
73112
- Control over attributes of result in :py:func:`merge`, :py:func:`concat`,
74113
:py:func:`combine_by_coords` and :py:func:`combine_nested` using
75114
combine_attrs keyword argument. (:issue:`3865`, :pull:`3877`)
@@ -79,19 +118,10 @@ New Features
79118
the exception when a dimension passed to ``isel`` is not present with a
80119
warning, or just ignore the dimension. (:issue:`3866`, :pull:`3923`)
81120
By `John Omotani <https://github.com/johnomotani>`_
82-
- Limited the length of array items with long string reprs to a
83-
reasonable width (:pull:`3900`)
84-
By `Maximilian Roos <https://github.com/max-sixty>`_
85-
- Limited the number of lines of large arrays when numpy reprs would have greater than 40.
86-
(:pull:`3905`)
87-
By `Maximilian Roos <https://github.com/max-sixty>`_
88-
- Implement :py:meth:`DataArray.idxmax`, :py:meth:`DataArray.idxmin`,
89-
:py:meth:`Dataset.idxmax`, :py:meth:`Dataset.idxmin`. (:issue:`60`, :pull:`3871`)
90-
By `Todd Jennings <https://github.com/toddrjen>`_
91121
- Support dask handling for :py:meth:`DataArray.idxmax`, :py:meth:`DataArray.idxmin`,
92122
:py:meth:`Dataset.idxmax`, :py:meth:`Dataset.idxmin`. (:pull:`3922`, :pull:`4135`)
93123
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_ and `Pascal Bourgault <https://github.com/aulemahal>`_.
94-
- More support for unit aware arrays with pint (:pull:`3643`, :pull:`3975`)
124+
- More support for unit aware arrays with pint (:pull:`3643`, :pull:`3975`, :pull:`4163`)
95125
By `Justus Magin <https://github.com/keewis>`_.
96126
- Support overriding existing variables in ``to_zarr()`` with ``mode='a'`` even
97127
without ``append_dim``, as long as dimension sizes do not change.
@@ -119,7 +149,30 @@ New Features
119149
(:py:func:`xarray.open_dataarray`, :py:func:`xarray.open_dataarray`,
120150
:py:func:`xarray.decode_cf`) that allows to disable/enable the decoding of timedeltas
121151
independently of time decoding (:issue:`1621`)
122-
`Aureliana Barghini <https://github.com/aurghs>`
152+
`Aureliana Barghini <https://github.com/aurghs>`_
153+
154+
Enhancements
155+
~~~~~~~~~~~~
156+
- Performance improvement of :py:meth:`DataArray.interp` and :py:func:`Dataset.interp`
157+
For orthogonal linear- and nearest-neighbor interpolation, we do 1d-interpolation sequentially
158+
rather than interpolating in multidimensional space. (:issue:`2223`)
159+
By `Keisuke Fujii <https://github.com/fujiisoup>`_.
160+
- Major performance improvement for :py:meth:`Dataset.from_dataframe` when the
161+
dataframe has a MultiIndex (:pull:`4184`).
162+
By `Stephan Hoyer <https://github.com/shoyer>`_.
163+
- :py:meth:`DataArray.reset_index` and :py:meth:`Dataset.reset_index` now keep
164+
coordinate attributes (:pull:`4103`). By `Oriol Abril <https://github.com/OriolAbril>`_.
165+
- Axes kwargs such as ``facecolor`` can now be passed to :py:meth:`DataArray.plot` in ``subplot_kws``.
166+
This works for both single axes plots and FacetGrid plots.
167+
By `Raphael Dussin <https://github.com/raphaeldussin>`_.
168+
- Array items with long string reprs are now limited to a
169+
reasonable width (:pull:`3900`)
170+
By `Maximilian Roos <https://github.com/max-sixty>`_
171+
- Large arrays whose numpy reprs would have greater than 40 lines are now
172+
limited to a reasonable length.
173+
(:pull:`3905`)
174+
By `Maximilian Roos <https://github.com/max-sixty>`_
175+
123176

124177
Bug fixes
125178
~~~~~~~~~
@@ -133,8 +186,9 @@ Bug fixes
133186
By `Deepak Cherian <https://github.com/dcherian>`_.
134187
- ``ValueError`` is raised when ``fill_value`` is not a scalar in :py:meth:`full_like`. (:issue:`3977`)
135188
By `Huite Bootsma <https://github.com/huite>`_.
136-
- Fix wrong order in converting a ``pd.Series`` with a MultiIndex to ``DataArray``. (:issue:`3951`)
137-
By `Keisuke Fujii <https://github.com/fujiisoup>`_.
189+
- Fix wrong order in converting a ``pd.Series`` with a MultiIndex to ``DataArray``.
190+
(:issue:`3951`, :issue:`4186`)
191+
By `Keisuke Fujii <https://github.com/fujiisoup>`_ and `Stephan Hoyer <https://github.com/shoyer>`_.
138192
- Fix renaming of coords when one or more stacked coords is not in
139193
sorted order during stack+groupby+apply operations. (:issue:`3287`,
140194
:pull:`3906`) By `Spencer Hill <https://github.com/spencerahill>`_
@@ -167,6 +221,8 @@ Bug fixes
167221
By `Mathias Hauser <https://github.com/mathause>`_.
168222
- Fix html repr in untrusted notebooks: fallback to plain text repr. (:pull:`4053`)
169223
By `Benoit Bovy <https://github.com/benbovy>`_.
224+
- Fix :py:meth:`DataArray.to_unstacked_dataset` for single-dimension variables. (:issue:`4049`)
225+
By `Deepak Cherian <https://github.com/dcherian>`_
170226
- Fix :py:func:`open_rasterio` for ``WarpedVRT`` with specified ``src_crs``. (:pull:`4104`)
171227
By `Dave Cole <https://github.com/dtpc>`_.
172228

0 commit comments

Comments
 (0)