Skip to content

Commit f3a5c25

Browse files
committed
address comments
1 parent b4258f6 commit f3a5c25

File tree

11 files changed

+233
-162
lines changed

11 files changed

+233
-162
lines changed

dpnp/dpnp_iface_mathematical.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,9 @@ def fmax(x1, x2, /, out=None, *, where=True, dtype=None, subok=True, **kwargs):
11321132
See Also
11331133
--------
11341134
:obj:`dpnp.maximum` : Element-wise maximum of array elements, propagates NaNs.
1135-
:obj:`dpnp.fmin` : Element-wise minimum of array elements, ignore NaNs.
1135+
:obj:`dpnp.fmin` : Element-wise minimum of array elements, ignores NaNs.
1136+
:obj:`dpnp.max` : The maximum value of an array along a given axis, propagates NaNs..
1137+
:obj:`dpnp.nanmax` : The maximum value of an array along a given axis, ignores NaNs.
11361138
:obj:`dpnp.minimum` : Element-wise minimum of array elements, propagates NaNs.
11371139
:obj:`dpnp.fmod` : Calculate the element-wise remainder of division.
11381140
@@ -1237,7 +1239,9 @@ def fmin(x1, x2, /, out=None, *, where=True, dtype=None, subok=True, **kwargs):
12371239
See Also
12381240
--------
12391241
:obj:`dpnp.minimum` : Element-wise minimum of array elements, propagates NaNs.
1240-
:obj:`dpnp.fmax` : Element-wise maximum of array elements, ignore NaNs.
1242+
:obj:`dpnp.fmax` : Element-wise maximum of array elements, ignores NaNs.
1243+
:obj:`dpnp.min` : The minimum value of an array along a given axis, propagates NaNs.
1244+
:obj:`dpnp.nanmin` : The minimum value of an array along a given axis, ignores NaNs.
12411245
:obj:`dpnp.maximum` : Element-wise maximum of array elements, propagates NaNs.
12421246
:obj:`dpnp.fmod` : Calculate the element-wise remainder of division.
12431247

dpnp/dpnp_iface_nanfunctions.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ def nanargmax(a, axis=None, out=None, *, keepdims=False):
109109
Parameters
110110
----------
111111
a : {dpnp_array, usm_ndarray}
112-
input array.
112+
Input array.
113113
axis : int, optional
114-
axis along which to search. If ``None``, the function must return
114+
Axis along which to search. If ``None``, the function must return
115115
the index of the maximum value of the flattened array.
116116
Default: ``None``.
117117
out : {dpnp_array, usm_ndarray}, optional
118-
if provided, the result will be inserted into this array. It should
118+
If provided, the result will be inserted into this array. It should
119119
be of the appropriate shape and dtype.
120120
keepdims : bool
121-
if ``True``, the reduced axes (dimensions) must be included in the
121+
If ``True``, the reduced axes (dimensions) must be included in the
122122
result as singleton dimensions, and, accordingly, the result must be
123123
compatible with the input array. Otherwise, if ``False``, the reduced
124124
axes (dimensions) must not be included in the result.
@@ -127,16 +127,16 @@ def nanargmax(a, axis=None, out=None, *, keepdims=False):
127127
Returns
128128
-------
129129
out : dpnp.ndarray
130-
if axis is ``None``, a zero-dimensional array containing the index of
131-
the first occurrence of the maximum value; otherwise, a non-zero-dimensional
132-
array containing the indices of the minimum values. The returned array
130+
If `axis` is ``None``, a zero-dimensional array containing the index of
131+
the first occurrence of the maximum value ignoring NaNs; otherwise, a non-zero-dimensional
132+
array containing the indices of the minimum values ignoring NaNs. The returned array
133133
must have the default array index data type.
134134
For all-NaN slices ``ValueError`` is raised.
135135
Warning: the results cannot be trusted if a slice contains only NaNs and -Infs.
136136
137137
Limitations
138138
-----------
139-
Input and output arrays are only supported as either :class:`dpnp.ndarray`
139+
Input array is only supported as either :class:`dpnp.ndarray`
140140
or :class:`dpctl.tensor.usm_ndarray`.
141141
Input array data types are limited by supported DPNP :ref:`Data types`.
142142
@@ -177,16 +177,16 @@ def nanargmin(a, axis=None, out=None, *, keepdims=False):
177177
Parameters
178178
----------
179179
a : {dpnp_array, usm_ndarray}
180-
input array.
180+
Input array.
181181
axis : int, optional
182-
axis along which to search. If ``None``, the function must return
182+
Axis along which to search. If ``None``, the function must return
183183
the index of the minimum value of the flattened array.
184184
Default: ``None``.
185185
out : {dpnp_array, usm_ndarray}, optional
186-
if provided, the result will be inserted into this array. It should
186+
If provided, the result will be inserted into this array. It should
187187
be of the appropriate shape and dtype.
188188
keepdims : bool
189-
if ``True``, the reduced axes (dimensions) must be included in the
189+
If ``True``, the reduced axes (dimensions) must be included in the
190190
result as singleton dimensions, and, accordingly, the result must be
191191
compatible with the input array. Otherwise, if ``False``, the reduced
192192
axes (dimensions) must not be included in the result.
@@ -195,9 +195,9 @@ def nanargmin(a, axis=None, out=None, *, keepdims=False):
195195
Returns
196196
-------
197197
out : dpnp.ndarray
198-
if axis is ``None``, a zero-dimensional array containing the index of
199-
the first occurrence of the minimum value; otherwise, a non-zero-dimensional
200-
array containing the indices of the minimum values. The returned array
198+
If `axis` is ``None``, a zero-dimensional array containing the index of
199+
the first occurrence of the minimum value ignoring NaNs; otherwise, a non-zero-dimensional
200+
array containing the indices of the minimum values ignoring NaNs. The returned array
201201
must have the default array index data type.
202202
For all-NaN slices ``ValueError`` is raised.
203203
Warning: the results cannot be trusted if a slice contains only NaNs and Infs.
@@ -319,17 +319,17 @@ def nanmax(a, axis=None, out=None, keepdims=False, initial=None, where=True):
319319
Parameters
320320
----------
321321
a : {dpnp_array, usm_ndarray}
322-
input array.
322+
Input array.
323323
axis : int or tuple of ints, optional
324-
axis or axes along which maximum values must be computed. By default,
324+
Axis or axes along which maximum values must be computed. By default,
325325
the maximum value must be computed over the entire array. If a tuple of integers,
326326
maximum values must be computed over multiple axes.
327327
Default: ``None``.
328328
out : {dpnp_array, usm_ndarray}, optional
329-
if provided, the result will be inserted into this array. It should
329+
If provided, the result will be inserted into this array. It should
330330
be of the appropriate shape and dtype.
331331
keepdims : bool
332-
if ``True``, the reduced axes (dimensions) must be included in the
332+
If ``True``, the reduced axes (dimensions) must be included in the
333333
result as singleton dimensions, and, accordingly, the result must be
334334
compatible with the input array. Otherwise, if ``False``, the reduced
335335
axes (dimensions) must not be included in the result.
@@ -338,7 +338,7 @@ def nanmax(a, axis=None, out=None, keepdims=False, initial=None, where=True):
338338
Returns
339339
-------
340340
out : dpnp.ndarray
341-
if the maximum value was computed over the entire array, a zero-dimensional array
341+
If the maximum value was computed over the entire array, a zero-dimensional array
342342
containing the maximum value ignoring NaNs; otherwise, a non-zero-dimensional array
343343
containing the maximum values ignoring NaNs. The returned array must have
344344
the same data type as `a`.
@@ -347,7 +347,7 @@ def nanmax(a, axis=None, out=None, keepdims=False, initial=None, where=True):
347347
348348
Limitations
349349
-----------
350-
Input and output arrays are only supported as either :class:`dpnp.ndarray`
350+
Input array is only supported as either :class:`dpnp.ndarray`
351351
or :class:`dpctl.tensor.usm_ndarray`.
352352
Parameters `where`, and `initial` are only supported with their default values.
353353
Otherwise ``NotImplementedError`` exception will be raised.
@@ -414,17 +414,17 @@ def nanmin(a, axis=None, out=None, keepdims=False, initial=None, where=True):
414414
Parameters
415415
----------
416416
a : {dpnp_array, usm_ndarray}
417-
input array.
417+
Input array.
418418
axis : int or tuple of ints, optional
419-
axis or axes along which minimum values must be computed. By default,
419+
Axis or axes along which minimum values must be computed. By default,
420420
the minimum value must be computed over the entire array. If a tuple of integers,
421421
minimum values must be computed over multiple axes.
422422
Default: ``None``.
423423
out : {dpnp_array, usm_ndarray}, optional
424-
if provided, the result will be inserted into this array. It should
424+
If provided, the result will be inserted into this array. It should
425425
be of the appropriate shape and dtype.
426426
keepdims : bool, optional
427-
if ``True``, the reduced axes (dimensions) must be included in the
427+
If ``True``, the reduced axes (dimensions) must be included in the
428428
result as singleton dimensions, and, accordingly, the result must be
429429
compatible with the input array. Otherwise, if ``False``, the reduced
430430
axes (dimensions) must not be included in the result.
@@ -433,7 +433,7 @@ def nanmin(a, axis=None, out=None, keepdims=False, initial=None, where=True):
433433
Returns
434434
-------
435435
out : dpnp.ndarray
436-
if the minimum value was computed over the entire array, a zero-dimensional array
436+
If the minimum value was computed over the entire array, a zero-dimensional array
437437
containing the minimum value ignoring NaNs; otherwise, a non-zero-dimensional array
438438
containing the minimum values ignoring NaNs. The returned array must have
439439
the same data type as `a`.
@@ -442,7 +442,7 @@ def nanmin(a, axis=None, out=None, keepdims=False, initial=None, where=True):
442442
443443
Limitations
444444
-----------
445-
Input and output arrays are only supported as either :class:`dpnp.ndarray`
445+
Input array is only supported as either :class:`dpnp.ndarray`
446446
or :class:`dpctl.tensor.usm_ndarray`.
447447
Parameters `where`, and `initial` are only supported with their default values.
448448
Otherwise ``NotImplementedError`` exception will be raised.

dpnp/dpnp_iface_searching.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ def argmax(a, axis=None, out=None, *, keepdims=False):
5858
Parameters
5959
----------
6060
a : {dpnp_array, usm_ndarray}
61-
input array.
61+
Input array.
6262
axis : int, optional
63-
axis along which to search. If ``None``, the function must return
63+
Axis along which to search. If ``None``, the function must return
6464
the index of the maximum value of the flattened array.
6565
Default: ``None``.
6666
out : {dpnp_array, usm_ndarray}, optional
67-
if provided, the result will be inserted into this array. It should
67+
If provided, the result will be inserted into this array. It should
6868
be of the appropriate shape and dtype.
6969
keepdims : bool
70-
if ``True``, the reduced axes (dimensions) must be included in the
70+
If ``True``, the reduced axes (dimensions) must be included in the
7171
result as singleton dimensions, and, accordingly, the result must be
7272
compatible with the input array. Otherwise, if ``False``, the reduced
7373
axes (dimensions) must not be included in the result.
@@ -76,7 +76,7 @@ def argmax(a, axis=None, out=None, *, keepdims=False):
7676
Returns
7777
-------
7878
out : dpnp.ndarray
79-
if axis is ``None``, a zero-dimensional array containing the index of
79+
If `axis` is ``None``, a zero-dimensional array containing the index of
8080
the first occurrence of the maximum value; otherwise, a non-zero-dimensional
8181
array containing the indices of the minimum values. The returned array
8282
must have the default array index data type.
@@ -142,16 +142,16 @@ def argmin(a, axis=None, out=None, *, keepdims=False):
142142
Parameters
143143
----------
144144
a : {dpnp_array, usm_ndarray}
145-
input array.
145+
Input array.
146146
axis : int, optional
147-
axis along which to search. If ``None``, the function must return
147+
Axis along which to search. If ``None``, the function must return
148148
the index of the minimum value of the flattened array.
149149
Default: ``None``.
150150
out : {dpnp_array, usm_ndarray}, optional
151-
if provided, the result will be inserted into this array. It should
151+
If provided, the result will be inserted into this array. It should
152152
be of the appropriate shape and dtype.
153153
keepdims : bool, optional
154-
if ``True``, the reduced axes (dimensions) must be included in the
154+
If ``True``, the reduced axes (dimensions) must be included in the
155155
result as singleton dimensions, and, accordingly, the result must be
156156
compatible with the input array. Otherwise, if ``False``, the reduced
157157
axes (dimensions) must not be included in the result.
@@ -160,7 +160,7 @@ def argmin(a, axis=None, out=None, *, keepdims=False):
160160
Returns
161161
-------
162162
out : dpnp.ndarray
163-
if axis is ``None``, a zero-dimensional array containing the index of
163+
If `axis` is ``None``, a zero-dimensional array containing the index of
164164
the first occurrence of the minimum value; otherwise, a non-zero-dimensional
165165
array containing the indices of the minimum values. The returned array
166166
must have the default array index data type.

dpnp/dpnp_iface_statistics.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,17 @@ def max(a, axis=None, out=None, keepdims=False, initial=None, where=True):
377377
Parameters
378378
----------
379379
a : {dpnp_array, usm_ndarray}
380-
input array.
380+
Input array.
381381
axis : int or tuple of ints, optional
382-
axis or axes along which maximum values must be computed. By default,
382+
Axis or axes along which maximum values must be computed. By default,
383383
the maximum value must be computed over the entire array. If a tuple of integers,
384384
maximum values must be computed over multiple axes.
385385
Default: ``None``.
386386
out : {dpnp_array, usm_ndarray}, optional
387-
if provided, the result will be inserted into this array. It should
387+
If provided, the result will be inserted into this array. It should
388388
be of the appropriate shape and dtype.
389389
keepdims : bool
390-
if ``True``, the reduced axes (dimensions) must be included in the
390+
If ``True``, the reduced axes (dimensions) must be included in the
391391
result as singleton dimensions, and, accordingly, the result must be
392392
compatible with the input array. Otherwise, if ``False``, the reduced
393393
axes (dimensions) must not be included in the result.
@@ -396,14 +396,14 @@ def max(a, axis=None, out=None, keepdims=False, initial=None, where=True):
396396
Returns
397397
-------
398398
out : dpnp.ndarray
399-
if the maximum value was computed over the entire array, a zero-dimensional array
400-
containing the maximum value ignoring NaNs; otherwise, a non-zero-dimensional array
401-
containing the maximum values ignoring NaNs. The returned array must have
399+
If the maximum value was computed over the entire array, a zero-dimensional array
400+
containing the maximum value; otherwise, a non-zero-dimensional array
401+
containing the maximum values. The returned array must have
402402
the same data type as `a`.
403403
404404
Limitations
405405
-----------
406-
Input and output arrays are only supported as either :class:`dpnp.ndarray`
406+
Input array is only supported as either :class:`dpnp.ndarray`
407407
or :class:`dpctl.tensor.usm_ndarray`.
408408
Parameters `where`, and `initial` are only supported with their default values.
409409
Otherwise ``NotImplementedError`` exception will be raised.
@@ -574,17 +574,17 @@ def min(a, axis=None, out=None, keepdims=False, initial=None, where=True):
574574
Parameters
575575
----------
576576
a : {dpnp_array, usm_ndarray}
577-
input array.
577+
Input array.
578578
axis : int or tuple of ints, optional
579-
axis or axes along which minimum values must be computed. By default,
579+
Axis or axes along which minimum values must be computed. By default,
580580
the minimum value must be computed over the entire array. If a tuple of integers,
581581
minimum values must be computed over multiple axes.
582582
Default: ``None``.
583583
out : {dpnp_array, usm_ndarray}, optional
584-
if provided, the result will be inserted into this array. It should
584+
If provided, the result will be inserted into this array. It should
585585
be of the appropriate shape and dtype.
586586
keepdims : bool, optional
587-
if ``True``, the reduced axes (dimensions) must be included in the
587+
If ``True``, the reduced axes (dimensions) must be included in the
588588
result as singleton dimensions, and, accordingly, the result must be
589589
compatible with the input array. Otherwise, if ``False``, the reduced
590590
axes (dimensions) must not be included in the result.
@@ -593,14 +593,14 @@ def min(a, axis=None, out=None, keepdims=False, initial=None, where=True):
593593
Returns
594594
-------
595595
out : dpnp.ndarray
596-
if the minimum value was computed over the entire array, a zero-dimensional array
597-
containing the minimum value ignoring NaNs; otherwise, a non-zero-dimensional array
598-
containing the minimum values ignoring NaNs. The returned array must have
596+
If the minimum value was computed over the entire array, a zero-dimensional array
597+
containing the minimum value; otherwise, a non-zero-dimensional array
598+
containing the minimum values. The returned array must have
599599
the same data type as `a`.
600600
601601
Limitations
602602
-----------
603-
Input and output arrays are only supported as either :class:`dpnp.ndarray`
603+
Input array is only supported as either :class:`dpnp.ndarray`
604604
or :class:`dpctl.tensor.usm_ndarray`.
605605
Parameters `where`, and `initial` are only supported with their default values.
606606
Otherwise ``NotImplementedError`` exception will be raised.

0 commit comments

Comments
 (0)