Skip to content

Commit 6852d01

Browse files
authored
update the docstring of diff (#3909)
* don't document the dim parameter as optional * update whats-new.rst * fix the reference syntax
1 parent b084064 commit 6852d01

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

doc/whats-new.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Bug fixes
4646

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

5054

5155
Internal Changes

xarray/core/dataarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2696,7 +2696,7 @@ def diff(self, dim: Hashable, n: int = 1, label: Hashable = "upper") -> "DataArr
26962696
26972697
Parameters
26982698
----------
2699-
dim : hashable, optional
2699+
dim : hashable
27002700
Dimension over which to calculate the finite difference.
27012701
n : int, optional
27022702
The number of times values are differenced.

xarray/core/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4901,7 +4901,7 @@ def diff(self, dim, n=1, label="upper"):
49014901
49024902
Parameters
49034903
----------
4904-
dim : str, optional
4904+
dim : str
49054905
Dimension over which to calculate the finite difference.
49064906
n : int, optional
49074907
The number of times values are differenced.

0 commit comments

Comments
 (0)