diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a994baddb5..bdf9991f548 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum * Changed the license from `BSD-2-Clause` to `BSD-3-Clause` [#2593](https://github.com/IntelPython/dpnp/pull/2593) * Defined explicit versions range of the Python interpreter which is needed during the build [#2634](https://github.com/IntelPython/dpnp/pull/2634) * Aligned documentation with NumPy and CuPy style by using short function names [#2633](https://github.com/IntelPython/dpnp/pull/2633) +* Added the missing positional-only and keyword-only parameter markers to bring the ufunc signatures into alignment with NumPy [#2660](https://github.com/IntelPython/dpnp/pull/2660) ### Deprecated diff --git a/dpnp/dpnp_algo/dpnp_elementwise_common.py b/dpnp/dpnp_algo/dpnp_elementwise_common.py index e2f75a92ed2..f874c606026 100644 --- a/dpnp/dpnp_algo/dpnp_elementwise_common.py +++ b/dpnp/dpnp_algo/dpnp_elementwise_common.py @@ -149,7 +149,9 @@ def _call_func(src, dst, sycl_queue, depends=None): def __call__( self, x, + /, out=None, + *, where=True, order="K", dtype=None, @@ -542,7 +544,9 @@ def __call__( self, x1, x2, + /, out=None, + *, where=True, order="K", dtype=None, @@ -746,7 +750,7 @@ def __init__( mkl_impl_fn=mkl_impl_fn, ) - def __call__(self, x, deg=False, out=None, order="K"): + def __call__(self, x, /, deg=False, *, out=None, order="K"): res = super().__call__(x, out=out, order=order) if deg is True: res *= 180 / dpnp.pi @@ -770,7 +774,7 @@ def __init__( docs, ) - def __call__(self, x, out=None, order="K"): + def __call__(self, x, /, out=None, *, order="K"): if not dpnp.is_supported_array_type(x): pass # pass to raise error in main implementation elif dpnp.issubdtype(x.dtype, dpnp.inexact): @@ -816,7 +820,7 @@ def __init__( mkl_impl_fn=mkl_impl_fn, ) - def __call__(self, x, out=None, order="K"): + def __call__(self, x, /, *, out=None, order="K"): return super().__call__(x, out=out, order=order) @@ -837,7 +841,7 @@ def __init__( docs, ) - def __call__(self, x, out=None, order="K"): + def __call__(self, x, /, *, out=None, order="K"): return super().__call__(x, out=out, order=order) @@ -858,7 +862,7 @@ def __init__( docs, ) - def __call__(self, x, out=None, order="K"): + def __call__(self, x, /, *, out=None, order="K"): if numpy.iscomplexobj(x): return super().__call__(x, out=out, order=order) return x @@ -885,7 +889,7 @@ def __init__( mkl_impl_fn=mkl_impl_fn, ) - def __call__(self, x, decimals=0, out=None, dtype=None): + def __call__(self, x, /, decimals=0, out=None, *, dtype=None): if decimals != 0: x_usm = dpnp.get_usm_ndarray(x) out_usm = None if out is None else dpnp.get_usm_ndarray(out) @@ -928,7 +932,7 @@ def __init__( docs, ) - def __call__(self, x, out=None, order="K"): + def __call__(self, x, /, *, out=None, order="K"): return super().__call__(x, out=out, order=order)