Skip to content

Commit 7a754f7

Browse files
Merge master into deprecated_out_arg
2 parents a0e4d77 + 6f6855b commit 7a754f7

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
3030
* Changed the license from `BSD-2-Clause` to `BSD-3-Clause` [#2593](https://github.com/IntelPython/dpnp/pull/2593)
3131
* Defined explicit versions range of the Python interpreter which is needed during the build [#2634](https://github.com/IntelPython/dpnp/pull/2634)
3232
* Aligned documentation with NumPy and CuPy style by using short function names [#2633](https://github.com/IntelPython/dpnp/pull/2633)
33+
* 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)
3334

3435
### Deprecated
3536

dpnp/dpnp_algo/dpnp_elementwise_common.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def _call_func(src, dst, sycl_queue, depends=None):
153153
def __call__(
154154
self,
155155
x,
156+
/,
156157
out=None,
158+
*,
157159
where=True,
158160
order="K",
159161
dtype=None,
@@ -546,7 +548,9 @@ def __call__(
546548
self,
547549
x1,
548550
x2,
551+
/,
549552
out=None,
553+
*,
550554
where=True,
551555
order="K",
552556
dtype=None,
@@ -766,7 +770,7 @@ def __init__(
766770
mkl_impl_fn=mkl_impl_fn,
767771
)
768772

769-
def __call__(self, x, deg=False, out=None, order="K"):
773+
def __call__(self, x, /, deg=False, *, out=None, order="K"):
770774
res = super().__call__(x, out=out, order=order)
771775
if deg is True:
772776
res *= 180 / dpnp.pi
@@ -790,7 +794,7 @@ def __init__(
790794
docs,
791795
)
792796

793-
def __call__(self, x, out=None, order="K"):
797+
def __call__(self, x, /, out=None, *, order="K"):
794798
if not dpnp.is_supported_array_type(x):
795799
pass # pass to raise error in main implementation
796800
elif dpnp.issubdtype(x.dtype, dpnp.inexact):
@@ -836,7 +840,7 @@ def __init__(
836840
mkl_impl_fn=mkl_impl_fn,
837841
)
838842

839-
def __call__(self, x, out=None, order="K"):
843+
def __call__(self, x, /, *, out=None, order="K"):
840844
return super().__call__(x, out=out, order=order)
841845

842846

@@ -857,7 +861,7 @@ def __init__(
857861
docs,
858862
)
859863

860-
def __call__(self, x, out=None, order="K"):
864+
def __call__(self, x, /, *, out=None, order="K"):
861865
return super().__call__(x, out=out, order=order)
862866

863867

@@ -878,7 +882,7 @@ def __init__(
878882
docs,
879883
)
880884

881-
def __call__(self, x, out=None, order="K"):
885+
def __call__(self, x, /, *, out=None, order="K"):
882886
if numpy.iscomplexobj(x):
883887
return super().__call__(x, out=out, order=order)
884888
return x
@@ -905,7 +909,7 @@ def __init__(
905909
mkl_impl_fn=mkl_impl_fn,
906910
)
907911

908-
def __call__(self, x, decimals=0, out=None, dtype=None):
912+
def __call__(self, x, /, decimals=0, out=None, *, dtype=None):
909913
if decimals != 0:
910914
x_usm = dpnp.get_usm_ndarray(x)
911915
out_usm = None if out is None else dpnp.get_usm_ndarray(out)
@@ -948,7 +952,7 @@ def __init__(
948952
docs,
949953
)
950954

951-
def __call__(self, x, out=None, order="K"):
955+
def __call__(self, x, /, *, out=None, order="K"):
952956
return super().__call__(x, out=out, order=order)
953957

954958

0 commit comments

Comments
 (0)