Skip to content

Commit 83ace79

Browse files
Deprecate positional out argument in dpnp.maximum
1 parent f519e26 commit 83ace79

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

dpnp/dpnp_iface_mathematical.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3257,14 +3257,31 @@ def interp(x, xp, fp, left=None, right=None, period=None):
32573257
32583258
"""
32593259

3260-
maximum = DPNPBinaryFunc(
3260+
_maximum_impl = DPNPBinaryFunc(
32613261
"maximum",
32623262
ti._maximum_result_type,
32633263
ti._maximum,
32643264
_MAXIMUM_DOCSTRING,
32653265
)
32663266

32673267

3268+
@wraps(_maximum_impl)
3269+
def maximum(*args, **kwargs):
3270+
"""
3271+
Wrapper around `_maximum_impl` that emits a DeprecationWarning
3272+
when `out` is passed positionally.
3273+
3274+
"""
3275+
if len(args) >= 3 and "out" not in kwargs:
3276+
warnings.warn(
3277+
"Positional `out` argument to `dpnp.maximum` is deprecated. "
3278+
"Please use the keyword form, e.g. `dpnp.maximum(a, b, out=c)`.",
3279+
DeprecationWarning,
3280+
stacklevel=2,
3281+
)
3282+
return _maximum_impl(*args, **kwargs)
3283+
3284+
32683285
_MINIMUM_DOCSTRING = """
32693286
Computes the minimum value for each element :math:`x1_i` of the input array `x1`
32703287
relative to the respective element :math:`x2_i` of the input array `x2`.

0 commit comments

Comments
 (0)