Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f98d6f0

Browse files
authored
small fixes for the docstrings of swap_dims and integrate (#4867)
* update the docstrings of integrate * also mention the removal version in whats-new.rst * update the docstrings of swap_dims [skip-ci] * add the PR [skip-ci]
1 parent 46591d2 commit f98d6f0

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

doc/whats-new.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ Deprecations
4747

4848
- ``dim`` argument to :py:meth:`DataArray.integrate` is being deprecated in
4949
favour of a ``coord`` argument, for consistency with :py:meth:`Dataset.integrate`.
50-
For now using ``dim`` issues a ``FutureWarning``. By `Tom Nicholas <https://github.com/TomNicholas>`_.
50+
For now using ``dim`` issues a ``FutureWarning``. It will be removed in
51+
version 0.19.0 (:pull:`3993`).
52+
By `Tom Nicholas <https://github.com/TomNicholas>`_.
5153

5254

5355
New Features

xarray/core/dataarray.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ def swap_dims(
17071707
dims_dict : dict-like
17081708
Dictionary whose keys are current dimension names and whose values
17091709
are new names.
1710-
**dim_kwargs : {dim: , ...}, optional
1710+
**dims_kwargs : {existing_dim: new_dim, ...}, optional
17111711
The keyword arguments form of ``dims_dict``.
17121712
One of dims_dict or dims_kwargs must be provided.
17131713
@@ -3479,21 +3479,22 @@ def integrate(
34793479
34803480
Parameters
34813481
----------
3482-
coord: hashable, or a sequence of hashable
3482+
coord : hashable, or sequence of hashable
34833483
Coordinate(s) used for the integration.
34843484
dim : hashable, or sequence of hashable
34853485
Coordinate(s) used for the integration.
3486-
datetime_unit: {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \
3486+
datetime_unit : {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \
34873487
'ps', 'fs', 'as'}, optional
3488+
Specify the unit if a datetime coordinate is used.
34883489
34893490
Returns
34903491
-------
3491-
integrated: DataArray
3492+
integrated : DataArray
34923493
34933494
See also
34943495
--------
34953496
Dataset.integrate
3496-
numpy.trapz: corresponding numpy function
3497+
numpy.trapz : corresponding numpy function
34973498
34983499
Examples
34993500
--------

xarray/core/dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,7 +3160,7 @@ def swap_dims(
31603160
dims_dict : dict-like
31613161
Dictionary whose keys are current dimension names and whose values
31623162
are new names.
3163-
**dim_kwargs : {existing_dim: new_dim, ...}, optional
3163+
**dims_kwargs : {existing_dim: new_dim, ...}, optional
31643164
The keyword arguments form of ``dims_dict``.
31653165
One of dims_dict or dims_kwargs must be provided.
31663166
@@ -5956,9 +5956,9 @@ def integrate(
59565956
59575957
Parameters
59585958
----------
5959-
coord: hashable, or a sequence of hashable
5959+
coord : hashable, or sequence of hashable
59605960
Coordinate(s) used for the integration.
5961-
datetime_unit: {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \
5961+
datetime_unit : {'Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', \
59625962
'ps', 'fs', 'as'}, optional
59635963
Specify the unit if datetime coordinate is used.
59645964
@@ -5969,7 +5969,7 @@ def integrate(
59695969
See also
59705970
--------
59715971
DataArray.integrate
5972-
numpy.trapz: corresponding numpy function
5972+
numpy.trapz : corresponding numpy function
59735973
59745974
Examples
59755975
--------

0 commit comments

Comments
 (0)