Skip to content

Commit

Permalink
docs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryevdv committed Feb 22, 2024
1 parent 2d2e4a0 commit fe4e4c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cunumeric/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -6255,6 +6255,7 @@ def diff(
The first difference is given by ``out[i] = a[i+1] - a[i]`` along
the given axis, higher differences are calculated by using `diff`
recursively.
Parameters
----------
a : array_like
Expand All @@ -6271,6 +6272,7 @@ def diff(
arrays with length 1 in the direction of axis and the shape
of the input array in along all other axes. Otherwise the
dimension and shape must match `a` except along axis.
Returns
-------
diff : ndarray
Expand All @@ -6279,17 +6281,21 @@ def diff(
type of the output is the same as the type of the difference
between any two elements of `a`. This is the same as the type of
`a` in most cases.
See Also
--------
numpy.diff
Notes
-----
Type is preserved for boolean arrays, so the result will contain
`False` when consecutive elements are the same and `True` when they
False when consecutive elements are the same and True when they
differ.
For unsigned integer arrays, the results will also be unsigned. This
should not be surprising, as the result is consistent with
calculating the difference directly:
>>> u8_arr = np.array([1, 0], dtype=np.uint8)
>>> np.diff(u8_arr)
array([255], dtype=uint8)
Expand All @@ -6300,8 +6306,10 @@ def diff(
>>> i16_arr = u8_arr.astype(np.int16)
>>> np.diff(i16_arr)
array([-1], dtype=int16)
Examples
--------
>>> x = np.array([1, 2, 4, 7, 0])
>>> np.diff(x)
array([ 1, 2, 3, -7])
Expand Down
1 change: 1 addition & 0 deletions docs/cunumeric/source/api/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Sums, products, differences
.. autosummary::
:toctree: generated/

diff
prod
sum
cumprod
Expand Down
1 change: 1 addition & 0 deletions docs/cunumeric/source/api/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Histograms

bincount
histogram
digitize


Order statistics
Expand Down

0 comments on commit fe4e4c0

Please sign in to comment.