Skip to content

Commit

Permalink
update the docstring of diff (#3909)
Browse files Browse the repository at this point in the history
* don't document the dim parameter as optional

* update whats-new.rst

* fix the reference syntax
  • Loading branch information
keewis authored Mar 28, 2020
1 parent b084064 commit 6852d01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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

0 comments on commit 6852d01

Please sign in to comment.