Skip to content

update the docstring of diff #3909

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

Merged
merged 3 commits into from
Mar 28, 2020
Merged
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
@@ -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
2 changes: 1 addition & 1 deletion xarray/core/dataarray.py
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
@@ -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.