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

update the docstring of diff #3909

Merged
merged 3 commits into from
Mar 28, 2020
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: 4 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Bug fixes

Documentation
~~~~~~~~~~~~~
- update the docstring of :py:meth:`Dataset.diff` and
:py:meth:`DataArray.diff` so it does document the ``dim``
parameter as required. (:issue:`1040`, :pull:`3909`)
By `Justus Magin <https://github.com/keewis>`_.


Internal Changes
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,7 @@ def diff(self, dim: Hashable, n: int = 1, label: Hashable = "upper") -> "DataArr

Parameters
----------
dim : hashable, optional
dim : hashable
Dimension over which to calculate the finite difference.
n : int, optional
The number of times values are differenced.
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4901,7 +4901,7 @@ def diff(self, dim, n=1, label="upper"):

Parameters
----------
dim : str, optional
dim : str
Dimension over which to calculate the finite difference.
n : int, optional
The number of times values are differenced.
Expand Down