Skip to content
forked from pydata/xarray

Commit

Permalink
Merge branch 'main' into api-reducitons
Browse files Browse the repository at this point in the history
* main:
  new whats-new.rst section
  Update open_rasterio deprecation version number (pydata#5916)
  v0.20 Release notes (pydata#5924)
  [skip-ci] v0.20.0: whats-new for release (pydata#5905)
  Update minimum dependencies for 0.20 (pydata#5917)
  Bump actions/github-script from 4.1 to 5 (pydata#5826)
  remove requirement for setuptools.pkg_resources (pydata#5845)
  Update docstring for apply_ufunc, set_options (pydata#5904)
  Display coords' units for slice plots (pydata#5847)
  • Loading branch information
dcherian committed Nov 3, 2021
2 parents cc6a004 + b3bc758 commit 7507c14
Show file tree
Hide file tree
Showing 36 changed files with 293 additions and 250 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
shopt -s globstar
python .github/workflows/parse_logs.py logs/**/*-log
- name: Report failures
uses: actions/github-script@v4.1
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down Expand Up @@ -158,15 +158,15 @@ jobs:
// If no issue is open, create a new issue,
// else update the body of the existing issue.
if (result.repository.issues.edges.length === 0) {
github.issues.create({
github.rest.issues.create({
owner: variables.owner,
repo: variables.name,
body: issue_body,
title: title,
labels: [variables.label]
})
} else {
github.issues.update({
github.rest.issues.update({
owner: variables.owner,
repo: variables.name,
issue_number: result.repository.issues.edges[0].node.number,
Expand Down
14 changes: 3 additions & 11 deletions ci/min_deps_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,16 @@
"isort",
"mypy",
"pip",
"setuptools",
"pytest",
"pytest-cov",
"pytest-env",
"pytest-xdist",
}

POLICY_MONTHS = {"python": 24, "numpy": 18, "setuptools": 42}
POLICY_MONTHS = {"python": 24, "numpy": 18}
POLICY_MONTHS_DEFAULT = 12
POLICY_OVERRIDE = {
# setuptools-scm doesn't work with setuptools < 36.7 (Nov 2017).
# The conda metadata is malformed for setuptools < 38.4 (Jan 2018)
# (it's missing a timestamp which prevents this tool from working).
# setuptools < 40.4 (Sep 2018) from conda-forge cannot be installed into a py37
# environment
# TODO remove this special case and the matching note in installing.rst
# after March 2022.
"setuptools": (40, 4),
}
POLICY_OVERRIDE: Dict[str, Tuple[int, int]] = {}
has_errors = False


Expand Down
5 changes: 2 additions & 3 deletions ci/requirements/py37-bare-minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- pytest-cov
- pytest-env
- pytest-xdist
- numpy=1.17
- pandas=1.0
- setuptools=40.4
- numpy=1.18
- pandas=1.1
- typing_extensions=3.7
31 changes: 16 additions & 15 deletions ci/requirements/py37-min-all-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,31 @@ dependencies:
- python=3.7
- boto3=1.13
- bottleneck=1.3
# cartopy 0.18 conflicts with pynio
- cartopy=0.17
- cdms2=3.1
- cfgrib=0.9
- cftime=1.1
- cftime=1.2
- coveralls
- dask=2.24
- distributed=2.24
- dask=2.30
- distributed=2.30
- h5netcdf=0.8
- h5py=2.10
# hdf5 1.12 conflicts with h5py=2.10
- hdf5=1.10
- hypothesis
- iris=2.4
- lxml=4.5 # Optional dep of pydap
- matplotlib-base=3.2
- lxml=4.6 # Optional dep of pydap
- matplotlib-base=3.3
- nc-time-axis=1.2
# netcdf follows a 1.major.minor[.patch] convention
# (see https://github.com/Unidata/netcdf4-python/issues/1090)
# bumping the netCDF4 version is currently blocked by #4491
- netcdf4=1.5.3
- numba=0.49
- numpy=1.17
- pandas=1.0
- pint=0.15
- numba=0.51
- numpy=1.18
- pandas=1.1
- pint=0.16
- pip
- pseudonetcdf=3.1
- pydap=3.2
Expand All @@ -42,12 +44,11 @@ dependencies:
- pytest-env
- pytest-xdist
- rasterio=1.1
- scipy=1.4
- seaborn=0.10
- setuptools=40.4
- sparse=0.8
- toolz=0.10
- scipy=1.5
- seaborn=0.11
- sparse=0.11
- toolz=0.11
- typing_extensions=3.7
- zarr=2.4
- zarr=2.5
- pip:
- numbagg==0.1
6 changes: 5 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,18 @@
"matplotlib colormap name": ":doc:`matplotlib colormap name <matplotlib:gallery/color/colormap_reference>`",
"matplotlib axes object": ":py:class:`matplotlib axes object <matplotlib.axes.Axes>`",
"colormap": ":py:class:`colormap <matplotlib.colors.Colormap>`",
# objects without namespace
# objects without namespace: xarray
"DataArray": "~xarray.DataArray",
"Dataset": "~xarray.Dataset",
"Variable": "~xarray.Variable",
"DatasetGroupBy": "~xarray.core.groupby.DatasetGroupBy",
"DataArrayGroupBy": "~xarray.core.groupby.DataArrayGroupBy",
# objects without namespace: numpy
"ndarray": "~numpy.ndarray",
"MaskedArray": "~numpy.ma.MaskedArray",
"dtype": "~numpy.dtype",
"ComplexWarning": "~numpy.ComplexWarning",
# objects without namespace: pandas
"Index": "~pandas.Index",
"MultiIndex": "~pandas.MultiIndex",
"CategoricalIndex": "~pandas.CategoricalIndex",
Expand Down
5 changes: 2 additions & 3 deletions doc/getting-started-guide/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Required dependencies
---------------------

- Python (3.7 or later)
- setuptools (40.4 or later)
- ``typing_extensions`` (3.7 or later)
- `importlib_metadata <https://importlib_metadata.readthedocs.io/>`__ (1.4 or later, Python 3.7 only)
- ``typing_extensions`` (3.7 or later, Python 3.7 only)
- `numpy <http://www.numpy.org/>`__ (1.17 or later)
- `pandas <http://pandas.pydata.org/>`__ (1.0 or later)

Expand Down Expand Up @@ -93,7 +93,6 @@ dependencies:

- **Python:** 24 months
(`NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_)
- **setuptools:** 42 months (but no older than 40.4)
- **numpy:** 18 months
(`NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_)
- **all other libraries:** 12 months
Expand Down
2 changes: 1 addition & 1 deletion doc/user-guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ GeoTIFFs and other gridded raster datasets can be opened using `rasterio`_, if
rasterio is installed. Here is an example of how to use
:py:func:`open_rasterio` to read one of rasterio's `test files`_:

.. deprecated:: 0.19.1
.. deprecated:: 0.20.0

Deprecated in favor of rioxarray.
For information about transitioning, see:
Expand Down
73 changes: 61 additions & 12 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,52 @@ What's New
np.random.seed(123456)
.. _whats-new.0.19.1:
.. _whats-new.0.20.1:

v0.19.1 (unreleased)
---------------------
.. TODO(by keewis): update deprecations if we decide to skip 0.19.1
v0.20.1 (*unreleased*)
----------------------

New Features
~~~~~~~~~~~~
- Add :py:meth:`var`, :py:meth:`std` and :py:meth:`sum_of_squares` to :py:meth:`Dataset.weighted` and :py:meth:`DataArray.weighted`.

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

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

Bug fixes
~~~~~~~~~

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

.. _whats-new.0.20.0:

v0.20.0 (1 November 2021)
-------------------------

This release brings improved support for pint arrays, methods for weighted standard deviation, variance,
and sum of squares, the option to disable the use of the bottleneck library, significantly improved performance of
unstack, as well as many bugfixes and internal changes.

Many thanks to the 38 contributors to this release!:

Aaron Spring, Akio Taniguchi, Alan D. Snow, arfy slowy, Benoit Bovy, Christian Jauvin, crusaderky, Deepak Cherian,
Giacomo Caria, Illviljan, James Bourbeau, Joe Hamman, Joseph K Aicher, Julien Herzen, Kai Mühlbauer,
keewis, lusewell, Martin K. Scherer, Mathias Hauser, Max Grover, Maxime Liquet, Maximilian Roos, Mike Taves, pmav99,
Pushkar Kopparla, Ray Bell, Rio McMahon, Scott Staniewicz, Spencer Clark, Stefan Bender, Taher Chegini, Thomas Nicholas,
Tomas Chor, Tom Augspurger, Victor Negîrneac, Zachary Moon, and Zeb Nicholls.

New Features
~~~~~~~~~~~~
- Add ``std``, ``var``, ``sum_of_squares`` to :py:class:`~core.weighted.DatasetWeighted` and :py:class:`~core.weighted.DataArrayWeighted`.
By `Christian Jauvin <https://github.com/cjauvin>`_.
- Added a :py:func:`get_options` method to xarray's root namespace (:issue:`5698`, :pull:`5716`)
By `Pushkar Kopparla <https://github.com/pkopparla>`_.
- Xarray now does a better job rendering variable names that are long LaTeX sequences when plotting (:issue:`5681`, :pull:`5682`).
By `Tomas Chor <https://github.com/tomchor>`_.
- Add an option to disable the use of ``bottleneck`` (:pull:`5560`)
- Add an option (``"use_bottleneck"``) to disable the use of ``bottleneck`` using :py:func:`set_options` (: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>`_.
Expand All @@ -38,6 +69,8 @@ New Features
`Nathan Lis <https://github.com/wxman22>`_.
- Histogram plots are set with a title displaying the scalar coords if any, similarly to the other plots (:issue:`5791`, :pull:`5792`).
By `Maxime Liquet <https://github.com/maximlt>`_.
- Slice plots display the coords units in the same way as x/y/colorbar labels (:pull:`5847`).
By `Victor Negîrneac <https://github.com/caenrigen>`_.
- Added a new :py:attr:`Dataset.chunksizes`, :py:attr:`DataArray.chunksizes`, and :py:attr:`Variable.chunksizes`
property, which will always return a mapping from dimension names to chunking pattern along that dimension,
regardless of whether the object is a Dataset, DataArray, or Variable. (:issue:`5846`, :pull:`5900`)
Expand All @@ -47,12 +80,24 @@ Breaking changes
~~~~~~~~~~~~~~~~
- The minimum versions of some dependencies were changed:

============ ====== ====
Package Old New
============ ====== ====
dask 2.15 2.24
distributed 2.15 2.24
============ ====== ====
=============== ====== ====
Package Old New
=============== ====== ====
cftime 1.1 1.2
dask 2.15 2.30
distributed 2.15 2.30
lxml 4.5 4.6
matplotlib-base 3.2 3.3
numba 0.49 0.51
numpy 1.17 1.18
pandas 1.0 1.1
pint 0.15 0.16
scipy 1.4 1.5
seaborn 0.10 0.11
sparse 0.8 0.11
toolz 0.10 0.11
zarr 2.4 2.5
=============== ====== ====

- The ``__repr__`` of a :py:class:`xarray.Dataset`'s ``coords`` and ``data_vars``
ignore ``xarray.set_option(display_max_rows=...)`` and show the full output
Expand Down Expand Up @@ -133,6 +178,10 @@ Internal Changes
By `Tom Nicholas <https://github.com/TomNicholas>`_.
- Add an ASV benchmark CI and improve performance of the benchmarks (:pull:`5796`)
By `Jimmy Westling <https://github.com/illviljan>`_.
- Use ``importlib`` to replace functionality of ``pkg_resources`` such
as version setting and loading of resources. (:pull:`5845`).
By `Martin K. Scherer <https://github.com/marscher>`_.


.. _whats-new.0.19.0:

Expand Down
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.htm
include_package_data = True
python_requires = >=3.7
install_requires =
numpy >= 1.17
pandas >= 1.0
typing_extensions >= 3.7
setuptools >= 40.4 # For pkg_resources
numpy >= 1.18
pandas >= 1.1
importlib-metadata; python_version < '3.8'
typing_extensions >= 3.7; python_version < '3.8'

[options.extras_require]
io =
Expand Down
10 changes: 7 additions & 3 deletions xarray/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pkg_resources

from . import testing, tutorial, ufuncs
from .backends.api import (
load_dataarray,
Expand Down Expand Up @@ -30,7 +28,13 @@
from .util.print_versions import show_versions

try:
__version__ = pkg_resources.get_distribution("xarray").version
from importlib.metadata import version as _version
except ImportError:
# if the fallback library is missing, we are doomed.
from importlib_metadata import version as _version # type: ignore[no-redef]

try:
__version__ = _version("xarray")
except Exception:
# Local copy or not installed with setuptools.
# Disable minimum version checks on downstream libraries.
Expand Down
Loading

0 comments on commit 7507c14

Please sign in to comment.