Skip to content

Commit d5de65b

Browse files
Merge pull request #1855 from IntelPython/fix-diff-docstring
Fix documentation warning when rendering `diff` docstring
2 parents 7ae2a91 + 82706e8 commit d5de65b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
* Use pybind11=2.13.6 [gh-1845](https://github.com/IntelPython/dpctl/pull/1845)
2424
* Remove unnecessary include in C++ header file [gh-1846](https://github.com/IntelPython/dpctl/pull/1846)
2525
* Build translation unit "simplify_iteration_space.cpp" compiled multiple times as a static library [gh-1847](https://github.com/IntelPython/dpctl/pull/1847)
26+
* Fix warning in documentation generation caused by `diff` docstring [gh-1855](https://github.com/IntelPython/dpctl/pull/1855)
2627

2728
## [0.18.0] - Sept. XX, 2024
2829

dpctl/tensor/_utility_functions.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def _boolean_reduction(x, axis, keepdims, func):
104104

105105

106106
def all(x, /, *, axis=None, keepdims=False):
107-
"""all(x, axis=None, keepdims=False)
107+
"""
108+
all(x, axis=None, keepdims=False)
108109
109110
Tests whether all input array elements evaluate to True along a given axis.
110111
@@ -132,7 +133,8 @@ def all(x, /, *, axis=None, keepdims=False):
132133

133134

134135
def any(x, /, *, axis=None, keepdims=False):
135-
"""any(x, axis=None, keepdims=False)
136+
"""
137+
any(x, axis=None, keepdims=False)
136138
137139
Tests whether any input array elements evaluate to True along a given axis.
138140
@@ -176,9 +178,11 @@ def _validate_diff_shape(sh1, sh2, axis):
176178

177179

178180
def _concat_diff_input(arr, axis, prepend, append):
179-
"""Concatenates `arr`, `prepend` and, `append` along `axis`,
181+
"""
182+
Concatenates `arr`, `prepend` and, `append` along `axis`,
180183
where `arr` is an array and `prepend` and `append` are
181-
any mixture of arrays and scalars."""
184+
any mixture of arrays and scalars.
185+
"""
182186
if prepend is not None and append is not None:
183187
q1, x_usm_type = arr.sycl_queue, arr.usm_type
184188
q2, prepend_usm_type = _get_queue_usm_type(prepend)
@@ -441,7 +445,8 @@ def diff(x, /, *, axis=-1, n=1, prepend=None, append=None):
441445
usm_ndarray:
442446
an array containing the `n`-th differences. The array will have the
443447
same shape as `x`, except along `axis`, which will have shape:
444-
prepend.shape[axis] + x.shape[axis] + append.shape[axis] - n
448+
``prepend.shape[axis] + x.shape[axis] + append.shape[axis] - n``
449+
445450
The data type of the returned array is determined by the Type
446451
Promotion Rules.
447452
"""

0 commit comments

Comments
 (0)