Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fixes for the docstrings of swap_dims and integrate #4867

Merged
merged 5 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ 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 <https://github.com/TomNicholas>`_.
For now using ``dim`` issues a ``FutureWarning``. It will be removed in
version 0.19.0 (:pull:`3993`).
By `Tom Nicholas <https://github.com/TomNicholas>`_.


New Features
Expand Down
11 changes: 6 additions & 5 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ def swap_dims(
dims_dict : dict-like
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.

Expand Down Expand Up @@ -3479,21 +3479,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
--------
Expand Down
8 changes: 4 additions & 4 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 +3160,7 @@ def swap_dims(
dims_dict : dict-like
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.

Expand Down Expand Up @@ -5956,9 +5956,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.

Expand All @@ -5969,7 +5969,7 @@ def integrate(
See also
--------
DataArray.integrate
numpy.trapz: corresponding numpy function
numpy.trapz : corresponding numpy function

Examples
--------
Expand Down