Skip to content

Commit 4ce8a6a

Browse files
committed
Merge branch 'main' into conditionally-disable-bottleneck
2 parents ad91a08 + 2977563 commit 4ce8a6a

26 files changed

+558
-299
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
$PYTEST_EXTRA_FLAGS
104104
105105
- name: Upload code coverage to Codecov
106-
uses: codecov/codecov-action@v1
106+
uses: codecov/codecov-action@v2.0.2
107107
with:
108108
file: ./coverage.xml
109109
flags: unittests,${{ matrix.env }}

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
path: pytest.xml
101101

102102
- name: Upload code coverage to Codecov
103-
uses: codecov/codecov-action@v1
103+
uses: codecov/codecov-action@v2.0.2
104104
with:
105105
file: ./coverage.xml
106106
flags: unittests

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ repos:
4343
types-pytz,
4444
# Dependencies that are typed
4545
numpy,
46+
typing-extensions==3.10.0.0,
4647
]
4748
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
4849
# - repo: https://github.com/asottile/pyupgrade

doc/api-hidden.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
core.rolling.DatasetCoarsen.var
5555
core.rolling.DatasetCoarsen.boundary
5656
core.rolling.DatasetCoarsen.coord_func
57-
core.rolling.DatasetCoarsen.keep_attrs
5857
core.rolling.DatasetCoarsen.obj
5958
core.rolling.DatasetCoarsen.side
6059
core.rolling.DatasetCoarsen.trim_excess
@@ -120,7 +119,6 @@
120119
core.rolling.DatasetRolling.var
121120
core.rolling.DatasetRolling.center
122121
core.rolling.DatasetRolling.dim
123-
core.rolling.DatasetRolling.keep_attrs
124122
core.rolling.DatasetRolling.min_periods
125123
core.rolling.DatasetRolling.obj
126124
core.rolling.DatasetRolling.rollings
@@ -199,7 +197,6 @@
199197
core.rolling.DataArrayCoarsen.var
200198
core.rolling.DataArrayCoarsen.boundary
201199
core.rolling.DataArrayCoarsen.coord_func
202-
core.rolling.DataArrayCoarsen.keep_attrs
203200
core.rolling.DataArrayCoarsen.obj
204201
core.rolling.DataArrayCoarsen.side
205202
core.rolling.DataArrayCoarsen.trim_excess
@@ -263,7 +260,6 @@
263260
core.rolling.DataArrayRolling.var
264261
core.rolling.DataArrayRolling.center
265262
core.rolling.DataArrayRolling.dim
266-
core.rolling.DataArrayRolling.keep_attrs
267263
core.rolling.DataArrayRolling.min_periods
268264
core.rolling.DataArrayRolling.obj
269265
core.rolling.DataArrayRolling.window

doc/api.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Top-level functions
2424
combine_by_coords
2525
combine_nested
2626
where
27-
set_options
2827
infer_freq
2928
full_like
3029
zeros_like
@@ -686,6 +685,7 @@ Dataset methods
686685
open_zarr
687686
Dataset.to_netcdf
688687
Dataset.to_pandas
688+
Dataset.as_numpy
689689
Dataset.to_zarr
690690
save_mfdataset
691691
Dataset.to_array
@@ -716,6 +716,8 @@ DataArray methods
716716
DataArray.to_pandas
717717
DataArray.to_series
718718
DataArray.to_dataframe
719+
DataArray.to_numpy
720+
DataArray.as_numpy
719721
DataArray.to_index
720722
DataArray.to_masked_array
721723
DataArray.to_cdms2

doc/getting-started-guide/installing.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Required dependencies
88

99
- Python (3.7 or later)
1010
- setuptools (40.4 or later)
11-
- typing-extensions (3.10 or later)
1211
- `numpy <http://www.numpy.org/>`__ (1.17 or later)
1312
- `pandas <http://pandas.pydata.org/>`__ (1.0 or later)
1413

doc/whats-new.rst

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,54 @@ What's New
1414
1515
np.random.seed(123456)
1616
17-
.. _whats-new.0.18.3:
1817
19-
v0.18.3 (unreleased)
18+
.. _whats-new.0.19.1:
19+
20+
v0.19.1 (unreleased)
2021
---------------------
2122

23+
New Features
24+
~~~~~~~~~~~~
25+
- Add a option to disable the use of ``bottleneck`` (:pull:`5560`)
26+
By `Justus Magin <https://github.com/keewis>`_.
27+
28+
29+
Breaking changes
30+
~~~~~~~~~~~~~~~~
31+
32+
33+
Deprecations
34+
~~~~~~~~~~~~
35+
36+
37+
Bug fixes
38+
~~~~~~~~~
39+
40+
41+
Documentation
42+
~~~~~~~~~~~~~
43+
44+
45+
Internal Changes
46+
~~~~~~~~~~~~~~~~
47+
48+
.. _whats-new.0.19.0:
49+
50+
v0.19.0 (23 July 2021)
51+
----------------------
52+
53+
This release brings improvements to plotting of categorical data, the ability to specify how attributes
54+
are combined in xarray operations, a new high-level :py:func:`unify_chunks` function, as well as various
55+
deprecations, bug fixes, and minor improvements.
56+
57+
58+
Many thanks to the 29 contributors to this release!:
59+
60+
Andrew Williams, Augustus, Aureliana Barghini, Benoit Bovy, crusaderky, Deepak Cherian, ellesmith88,
61+
Elliott Sales de Andrade, Giacomo Caria, github-actions[bot], Illviljan, Joeperdefloep, joooeey, Julia Kent,
62+
Julius Busecke, keewis, Mathias Hauser, Matthias Göbel, Mattia Almansi, Maximilian Roos, Peter Andreas Entschev,
63+
Ray Bell, Sander, Santiago Soler, Sebastian, Spencer Clark, Stephan Hoyer, Thomas Hirtz, Thomas Nicholas.
64+
2265
New Features
2366
~~~~~~~~~~~~
2467
- Allow passing argument ``missing_dims`` to :py:meth:`Variable.transpose` and :py:meth:`Dataset.transpose`
@@ -56,8 +99,12 @@ New Features
5699
- Allow removal of the coordinate attribute ``coordinates`` on variables by setting ``.attrs['coordinates']= None``
57100
(:issue:`5510`).
58101
By `Elle Smith <https://github.com/ellesmith88>`_.
59-
- Add a option to disable the use of ``bottleneck`` (:pull:`5560`)
60-
By `Justus Magin <https://github.com/keewis>`_.
102+
- Added ``**kwargs`` argument to :py:meth:`open_rasterio` to access overviews (:issue:`3269`).
103+
By `Pushkar Kopparla <https://github.com/pkopparla>`_.
104+
- Added :py:meth:`DataArray.to_numpy`, :py:meth:`DataArray.as_numpy`, and :py:meth:`Dataset.as_numpy`. (:pull:`5568`).
105+
By `Tom Nicholas <https://github.com/TomNicholas>`_.
106+
- Units in plot labels are now automatically inferred from wrapped :py:meth:`pint.Quantity` arrays. (:pull:`5561`).
107+
By `Tom Nicholas <https://github.com/TomNicholas>`_.
61108

62109
Breaking changes
63110
~~~~~~~~~~~~~~~~
@@ -75,6 +122,10 @@ Breaking changes
75122
Deprecations
76123
~~~~~~~~~~~~
77124

125+
- Removed the deprecated ``dim`` kwarg to :py:func:`DataArray.integrate` (:pull:`5630`)
126+
- Removed the deprecated ``keep_attrs`` kwarg to :py:func:`DataArray.rolling` (:pull:`5630`)
127+
- Removed the deprecated ``keep_attrs`` kwarg to :py:func:`DataArray.coarsen` (:pull:`5630`)
128+
- Completed deprecation of passing an ``xarray.DataArray`` to :py:func:`Variable` - will now raise a ``TypeError`` (:pull:`5630`)
78129

79130
Bug fixes
80131
~~~~~~~~~
@@ -99,10 +150,6 @@ Bug fixes
99150
By `Augustus Ijams <https://github.com/aijams>`_.
100151

101152

102-
Documentation
103-
~~~~~~~~~~~~~
104-
105-
106153
Internal Changes
107154
~~~~~~~~~~~~~~~~
108155
- Run CI on the first & last python versions supported only; currently 3.7 & 3.9.
@@ -111,7 +158,6 @@ Internal Changes
111158
- Publish test results & timings on each PR.
112159
(:pull:`5537`)
113160
By `Maximilian Roos <https://github.com/max-sixty>`_.
114-
115161
- Explicit indexes refactor: add a ``xarray.Index.query()`` method in which
116162
one may eventually provide a custom implementation of label-based data
117163
selection (not ready yet for public use). Also refactor the internal,
@@ -156,13 +202,6 @@ New Features
156202
- Raise more informative error when decoding time variables with invalid reference dates.
157203
(:issue:`5199`, :pull:`5288`). By `Giacomo Caria <https://github.com/gcaria>`_.
158204

159-
Breaking changes
160-
~~~~~~~~~~~~~~~~
161-
162-
163-
Deprecations
164-
~~~~~~~~~~~~
165-
166205

167206
Bug fixes
168207
~~~~~~~~~

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ classifiers =
6767
Programming Language :: Python :: 3.7
6868
Programming Language :: Python :: 3.8
6969
Programming Language :: Python :: 3.9
70+
Programming Language :: Python :: 3.10
7071
Topic :: Scientific/Engineering
7172

7273
[options]
@@ -78,7 +79,6 @@ install_requires =
7879
numpy >= 1.17
7980
pandas >= 1.0
8081
setuptools >= 40.4 # For pkg_resources
81-
typing-extensions >= 3.10 # Backported type hints
8282

8383
[options.extras_require]
8484
io =

xarray/backends/rasterio_.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,14 @@ def default(s):
162162
return parsed_meta
163163

164164

165-
def open_rasterio(filename, parse_coordinates=None, chunks=None, cache=None, lock=None):
165+
def open_rasterio(
166+
filename,
167+
parse_coordinates=None,
168+
chunks=None,
169+
cache=None,
170+
lock=None,
171+
**kwargs,
172+
):
166173
"""Open a file with rasterio (experimental).
167174
168175
This should work with any file that rasterio can open (most often:
@@ -272,7 +279,13 @@ def open_rasterio(filename, parse_coordinates=None, chunks=None, cache=None, loc
272279
if lock is None:
273280
lock = RASTERIO_LOCK
274281

275-
manager = CachingFileManager(rasterio.open, filename, lock=lock, mode="r")
282+
manager = CachingFileManager(
283+
rasterio.open,
284+
filename,
285+
lock=lock,
286+
mode="r",
287+
kwargs=kwargs,
288+
)
276289
riods = manager.acquire()
277290
if vrt_params is not None:
278291
riods = WarpedVRT(riods, **vrt_params)

xarray/core/combine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def _combine_single_variable_hypercube(
635635
return concatenated
636636

637637

638-
# TODO remove empty list default param after version 0.19, see PR4696
638+
# TODO remove empty list default param after version 0.21, see PR4696
639639
def combine_by_coords(
640640
data_objects=[],
641641
compat="no_conflicts",
@@ -849,11 +849,11 @@ def combine_by_coords(
849849
precipitation (y, x) float64 0.4376 0.8918 0.9637 ... 0.5684 0.01879 0.6176
850850
"""
851851

852-
# TODO remove after version 0.19, see PR4696
852+
# TODO remove after version 0.21, see PR4696
853853
if datasets is not None:
854854
warnings.warn(
855855
"The datasets argument has been renamed to `data_objects`."
856-
" In future passing a value for datasets will raise an error."
856+
" From 0.21 on passing a value for datasets will raise an error."
857857
)
858858
data_objects = datasets
859859

xarray/core/common.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,6 @@ def rolling(
821821
dim: Mapping[Hashable, int] = None,
822822
min_periods: int = None,
823823
center: Union[bool, Mapping[Hashable, bool]] = False,
824-
keep_attrs: bool = None,
825824
**window_kwargs: int,
826825
):
827826
"""
@@ -889,9 +888,7 @@ def rolling(
889888
"""
890889

891890
dim = either_dict_or_kwargs(dim, window_kwargs, "rolling")
892-
return self._rolling_cls(
893-
self, dim, min_periods=min_periods, center=center, keep_attrs=keep_attrs
894-
)
891+
return self._rolling_cls(self, dim, min_periods=min_periods, center=center)
895892

896893
def rolling_exp(
897894
self,
@@ -940,7 +937,6 @@ def coarsen(
940937
boundary: str = "exact",
941938
side: Union[str, Mapping[Hashable, str]] = "left",
942939
coord_func: str = "mean",
943-
keep_attrs: bool = None,
944940
**window_kwargs: int,
945941
):
946942
"""
@@ -1009,7 +1005,6 @@ def coarsen(
10091005
boundary=boundary,
10101006
side=side,
10111007
coord_func=coord_func,
1012-
keep_attrs=keep_attrs,
10131008
)
10141009

10151010
def resample(

0 commit comments

Comments
 (0)