Skip to content

Commit

Permalink
Merge branch 'main' into conditionally-disable-bottleneck
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Jul 30, 2021
2 parents ad91a08 + 2977563 commit cfeffa4
Show file tree
Hide file tree
Showing 26 changed files with 558 additions and 299 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
$PYTEST_EXTRA_FLAGS
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2.0.2
with:
file: ./coverage.xml
flags: unittests,${{ matrix.env }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
path: pytest.xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2.0.2
with:
file: ./coverage.xml
flags: unittests
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ repos:
types-pytz,
# Dependencies that are typed
numpy,
typing-extensions==3.10.0.0,
]
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
# - repo: https://github.com/asottile/pyupgrade
Expand Down
4 changes: 0 additions & 4 deletions doc/api-hidden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
core.rolling.DatasetCoarsen.var
core.rolling.DatasetCoarsen.boundary
core.rolling.DatasetCoarsen.coord_func
core.rolling.DatasetCoarsen.keep_attrs
core.rolling.DatasetCoarsen.obj
core.rolling.DatasetCoarsen.side
core.rolling.DatasetCoarsen.trim_excess
Expand Down Expand Up @@ -120,7 +119,6 @@
core.rolling.DatasetRolling.var
core.rolling.DatasetRolling.center
core.rolling.DatasetRolling.dim
core.rolling.DatasetRolling.keep_attrs
core.rolling.DatasetRolling.min_periods
core.rolling.DatasetRolling.obj
core.rolling.DatasetRolling.rollings
Expand Down Expand Up @@ -199,7 +197,6 @@
core.rolling.DataArrayCoarsen.var
core.rolling.DataArrayCoarsen.boundary
core.rolling.DataArrayCoarsen.coord_func
core.rolling.DataArrayCoarsen.keep_attrs
core.rolling.DataArrayCoarsen.obj
core.rolling.DataArrayCoarsen.side
core.rolling.DataArrayCoarsen.trim_excess
Expand Down Expand Up @@ -263,7 +260,6 @@
core.rolling.DataArrayRolling.var
core.rolling.DataArrayRolling.center
core.rolling.DataArrayRolling.dim
core.rolling.DataArrayRolling.keep_attrs
core.rolling.DataArrayRolling.min_periods
core.rolling.DataArrayRolling.obj
core.rolling.DataArrayRolling.window
Expand Down
4 changes: 3 additions & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Top-level functions
combine_by_coords
combine_nested
where
set_options
infer_freq
full_like
zeros_like
Expand Down Expand Up @@ -686,6 +685,7 @@ Dataset methods
open_zarr
Dataset.to_netcdf
Dataset.to_pandas
Dataset.as_numpy
Dataset.to_zarr
save_mfdataset
Dataset.to_array
Expand Down Expand Up @@ -716,6 +716,8 @@ DataArray methods
DataArray.to_pandas
DataArray.to_series
DataArray.to_dataframe
DataArray.to_numpy
DataArray.as_numpy
DataArray.to_index
DataArray.to_masked_array
DataArray.to_cdms2
Expand Down
1 change: 0 additions & 1 deletion doc/getting-started-guide/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Required dependencies

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

Expand Down
71 changes: 55 additions & 16 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,56 @@ What's New
np.random.seed(123456)
.. _whats-new.0.18.3:
v0.18.3 (unreleased)
.. _whats-new.0.19.1:

v0.19.1 (unreleased)
---------------------

New Features
~~~~~~~~~~~~
- Add a option to disable the use of ``bottleneck`` (:pull:`5560`)
By `Justus Magin <https://github.com/keewis>`_.
- Added ``**kwargs`` argument to :py:meth:`open_rasterio` to access overviews (:issue:`3269`).
By `Pushkar Kopparla <https://github.com/pkopparla>`_.


Breaking changes
~~~~~~~~~~~~~~~~


Deprecations
~~~~~~~~~~~~


Bug fixes
~~~~~~~~~


Documentation
~~~~~~~~~~~~~


Internal Changes
~~~~~~~~~~~~~~~~

.. _whats-new.0.19.0:

v0.19.0 (23 July 2021)
----------------------

This release brings improvements to plotting of categorical data, the ability to specify how attributes
are combined in xarray operations, a new high-level :py:func:`unify_chunks` function, as well as various
deprecations, bug fixes, and minor improvements.


Many thanks to the 29 contributors to this release!:

Andrew Williams, Augustus, Aureliana Barghini, Benoit Bovy, crusaderky, Deepak Cherian, ellesmith88,
Elliott Sales de Andrade, Giacomo Caria, github-actions[bot], Illviljan, Joeperdefloep, joooeey, Julia Kent,
Julius Busecke, keewis, Mathias Hauser, Matthias Göbel, Mattia Almansi, Maximilian Roos, Peter Andreas Entschev,
Ray Bell, Sander, Santiago Soler, Sebastian, Spencer Clark, Stephan Hoyer, Thomas Hirtz, Thomas Nicholas.

New Features
~~~~~~~~~~~~
- Allow passing argument ``missing_dims`` to :py:meth:`Variable.transpose` and :py:meth:`Dataset.transpose`
Expand Down Expand Up @@ -56,8 +101,10 @@ New Features
- Allow removal of the coordinate attribute ``coordinates`` on variables by setting ``.attrs['coordinates']= None``
(:issue:`5510`).
By `Elle Smith <https://github.com/ellesmith88>`_.
- Add a option to disable the use of ``bottleneck`` (:pull:`5560`)
By `Justus Magin <https://github.com/keewis>`_.
- Added :py:meth:`DataArray.to_numpy`, :py:meth:`DataArray.as_numpy`, and :py:meth:`Dataset.as_numpy`. (:pull:`5568`).
By `Tom Nicholas <https://github.com/TomNicholas>`_.
- Units in plot labels are now automatically inferred from wrapped :py:meth:`pint.Quantity` arrays. (:pull:`5561`).
By `Tom Nicholas <https://github.com/TomNicholas>`_.

Breaking changes
~~~~~~~~~~~~~~~~
Expand All @@ -75,6 +122,10 @@ Breaking changes
Deprecations
~~~~~~~~~~~~

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

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


Documentation
~~~~~~~~~~~~~


Internal Changes
~~~~~~~~~~~~~~~~
- Run CI on the first & last python versions supported only; currently 3.7 & 3.9.
Expand All @@ -111,7 +158,6 @@ Internal Changes
- Publish test results & timings on each PR.
(:pull:`5537`)
By `Maximilian Roos <https://github.com/max-sixty>`_.

- Explicit indexes refactor: add a ``xarray.Index.query()`` method in which
one may eventually provide a custom implementation of label-based data
selection (not ready yet for public use). Also refactor the internal,
Expand Down Expand Up @@ -156,13 +202,6 @@ New Features
- Raise more informative error when decoding time variables with invalid reference dates.
(:issue:`5199`, :pull:`5288`). By `Giacomo Caria <https://github.com/gcaria>`_.

Breaking changes
~~~~~~~~~~~~~~~~


Deprecations
~~~~~~~~~~~~


Bug fixes
~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering

[options]
Expand All @@ -78,7 +79,6 @@ install_requires =
numpy >= 1.17
pandas >= 1.0
setuptools >= 40.4 # For pkg_resources
typing-extensions >= 3.10 # Backported type hints

[options.extras_require]
io =
Expand Down
17 changes: 15 additions & 2 deletions xarray/backends/rasterio_.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ def default(s):
return parsed_meta


def open_rasterio(filename, parse_coordinates=None, chunks=None, cache=None, lock=None):
def open_rasterio(
filename,
parse_coordinates=None,
chunks=None,
cache=None,
lock=None,
**kwargs,
):
"""Open a file with rasterio (experimental).
This should work with any file that rasterio can open (most often:
Expand Down Expand Up @@ -272,7 +279,13 @@ def open_rasterio(filename, parse_coordinates=None, chunks=None, cache=None, loc
if lock is None:
lock = RASTERIO_LOCK

manager = CachingFileManager(rasterio.open, filename, lock=lock, mode="r")
manager = CachingFileManager(
rasterio.open,
filename,
lock=lock,
mode="r",
kwargs=kwargs,
)
riods = manager.acquire()
if vrt_params is not None:
riods = WarpedVRT(riods, **vrt_params)
Expand Down
6 changes: 3 additions & 3 deletions xarray/core/combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def _combine_single_variable_hypercube(
return concatenated


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

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

Expand Down
7 changes: 1 addition & 6 deletions xarray/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ def rolling(
dim: Mapping[Hashable, int] = None,
min_periods: int = None,
center: Union[bool, Mapping[Hashable, bool]] = False,
keep_attrs: bool = None,
**window_kwargs: int,
):
"""
Expand Down Expand Up @@ -889,9 +888,7 @@ def rolling(
"""

dim = either_dict_or_kwargs(dim, window_kwargs, "rolling")
return self._rolling_cls(
self, dim, min_periods=min_periods, center=center, keep_attrs=keep_attrs
)
return self._rolling_cls(self, dim, min_periods=min_periods, center=center)

def rolling_exp(
self,
Expand Down Expand Up @@ -940,7 +937,6 @@ def coarsen(
boundary: str = "exact",
side: Union[str, Mapping[Hashable, str]] = "left",
coord_func: str = "mean",
keep_attrs: bool = None,
**window_kwargs: int,
):
"""
Expand Down Expand Up @@ -1009,7 +1005,6 @@ def coarsen(
boundary=boundary,
side=side,
coord_func=coord_func,
keep_attrs=keep_attrs,
)

def resample(
Expand Down
Loading

0 comments on commit cfeffa4

Please sign in to comment.