From 1bcb2e852082f4101f696d118b73dca25128d7a1 Mon Sep 17 00:00:00 2001 From: Keewis Date: Fri, 5 Feb 2021 22:46:16 +0100 Subject: [PATCH 1/4] update the docstrings of integrate --- xarray/core/dataarray.py | 9 +++++---- xarray/core/dataset.py | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 0155cdc4e19..ade49226cc3 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -3495,21 +3495,22 @@ def integrate( Parameters ---------- - coord: hashable, or a sequence of hashable + coord : hashable, or sequence of hashable Coordinate(s) used for the integration. dim : hashable, or sequence of hashable Coordinate(s) used for the integration. - datetime_unit: {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \ + datetime_unit : {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \ 'ps', 'fs', 'as'}, optional + Specify the unit if a datetime coordinate is used. Returns ------- - integrated: DataArray + integrated : DataArray See also -------- Dataset.integrate - numpy.trapz: corresponding numpy function + numpy.trapz : corresponding numpy function Examples -------- diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 8376b4875f9..e4ff8518192 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -5974,9 +5974,9 @@ def integrate( Parameters ---------- - coord: hashable, or a sequence of hashable + coord : hashable, or sequence of hashable Coordinate(s) used for the integration. - datetime_unit: {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \ + datetime_unit : {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \ 'ps', 'fs', 'as'}, optional Specify the unit if datetime coordinate is used. @@ -5987,7 +5987,7 @@ def integrate( See also -------- DataArray.integrate - numpy.trapz: corresponding numpy function + numpy.trapz : corresponding numpy function Examples -------- From 6c2dc1bcadfba4a1d910c5da1a38a7bebeead4e2 Mon Sep 17 00:00:00 2001 From: Keewis Date: Fri, 5 Feb 2021 22:59:38 +0100 Subject: [PATCH 2/4] also mention the removal version in whats-new.rst --- doc/whats-new.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 471e91a8512..1c47241362c 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -47,7 +47,8 @@ Deprecations - ``dim`` argument to :py:meth:`DataArray.integrate` is being deprecated in favour of a ``coord`` argument, for consistency with :py:meth:`Dataset.integrate`. - For now using ``dim`` issues a ``FutureWarning``. By `Tom Nicholas `_. + For now using ``dim`` issues a ``FutureWarning``. It will be removed in version 0.19.0. + By `Tom Nicholas `_. New Features From fdee426a4e445545030bcf9718b701c558d57193 Mon Sep 17 00:00:00 2001 From: Keewis Date: Fri, 5 Feb 2021 23:01:56 +0100 Subject: [PATCH 3/4] update the docstrings of swap_dims [skip-ci] --- xarray/core/dataarray.py | 2 +- xarray/core/dataset.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index ade49226cc3..4ae79010bfa 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -1710,7 +1710,7 @@ def swap_dims( Dictionary whose keys are current dimension names and whose values are new names. - **dim_kwargs : {dim: , ...}, optional + **dims_kwargs : {existing_dim: new_dim, ...}, optional The keyword arguments form of ``dims_dict``. One of dims_dict or dims_kwargs must be provided. diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index e4ff8518192..848cdeb1d14 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -3167,7 +3167,7 @@ def swap_dims( Dictionary whose keys are current dimension names and whose values are new names. - **dim_kwargs : {existing_dim: new_dim, ...}, optional + **dims_kwargs : {existing_dim: new_dim, ...}, optional The keyword arguments form of ``dims_dict``. One of dims_dict or dims_kwargs must be provided. From f0dcad0d8322c51074fafb757c0902d484b0a2ad Mon Sep 17 00:00:00 2001 From: Keewis Date: Sun, 7 Feb 2021 00:07:39 +0100 Subject: [PATCH 4/4] add the PR [skip-ci] --- doc/whats-new.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 1c47241362c..922b3528027 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -47,7 +47,8 @@ Deprecations - ``dim`` argument to :py:meth:`DataArray.integrate` is being deprecated in favour of a ``coord`` argument, for consistency with :py:meth:`Dataset.integrate`. - For now using ``dim`` issues a ``FutureWarning``. It will be removed in version 0.19.0. + For now using ``dim`` issues a ``FutureWarning``. It will be removed in + version 0.19.0 (:pull:`3993`). By `Tom Nicholas `_.