From 390e0e97140a5ca3b50024f23664bb20b8e1b8f2 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 18:57:15 +0100 Subject: [PATCH 1/8] Remove __array_prepare__ (removed in numpy since 2.0) --- dpnp/dpnp_array.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index 365d01a179a..dae4ac18d3a 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -173,7 +173,6 @@ def __array_namespace__(self, /, *, api_version=None): return self._array_obj.__array_namespace__(api_version=api_version) - # '__array_prepare__', # '__array_priority__', # '__array_struct__', From ec948f7c4810b5a619d59fa2003f36ca1a0d40ba Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 19:01:32 +0100 Subject: [PATCH 2/8] No need to override special method __delattr__ --- dpnp/dpnp_array.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index dae4ac18d3a..7b76cc1eb4b 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -206,7 +206,6 @@ def __copy__(self): return self.copy(order="K") # '__deepcopy__', - # '__delattr__', # '__delitem__', # '__dir__', # '__divmod__', From 63b8b2d9c213fe0299177e587cffe3b576be6d78 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 19:17:01 +0100 Subject: [PATCH 3/8] No need to override __delitem__ numpy.ndarray has it, but raised "ValueError: cannot delete array elements" when trying to delete an element in the array. --- dpnp/dpnp_array.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index 7b76cc1eb4b..4a749de9360 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -206,7 +206,6 @@ def __copy__(self): return self.copy(order="K") # '__deepcopy__', - # '__delitem__', # '__dir__', # '__divmod__', From bcfe45df18f51bb19f91938b11b0d69bdfee5873 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 19:28:01 +0100 Subject: [PATCH 4/8] No need to override __doc__ attribute --- dpnp/dpnp_array.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index 4a749de9360..d9c37b564e5 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -289,8 +289,6 @@ def __dlpack_device__(self, /): return self._array_obj.__dlpack_device__() - # '__doc__', - def __eq__(self, other, /): r"""Return :math:`\text{self == value}`.""" return dpnp.equal(self, other) From 72e99c28836a9cb1725e3a43e8da9264662983a2 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 19:33:19 +0100 Subject: [PATCH 5/8] No need to override __getattribute__ method NumPy and CuPy used default one also. --- dpnp/dpnp_array.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index d9c37b564e5..2fbe9158499 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -307,8 +307,6 @@ def __ge__(self, other, /): r"""Return :math:`\text{self >= value}`.""" return dpnp.greater_equal(self, other) - # '__getattribute__', - def __getitem__(self, key, /): r"""Return :math:`\text{self[key]}`.""" key = _get_unwrapped_index_key(key) From 31ad2993eb7571581bf927c1271665cd21d629e8 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 19:39:58 +0100 Subject: [PATCH 6/8] Remove already implemented __init__ method --- dpnp/dpnp_array.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index 2fbe9158499..14ddcd02cce 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -380,7 +380,6 @@ def __index__(self, /): """Convert a zero-dimensional array to a Python int object.""" return self._array_obj.__index__() - # '__init__', # '__init_subclass__', def __int__(self, /): From 44a45414078e00d379ef910227d64074c114ccbc Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 19:48:35 +0100 Subject: [PATCH 7/8] No need to override special method __setattr__ --- dpnp/dpnp_array.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index 14ddcd02cce..5753624fac4 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -544,8 +544,6 @@ def __rxor__(self, other, /): r"""Return :math:`\text{value ^ self}`.""" return dpnp.bitwise_xor(other, self) - # '__setattr__', - def __setitem__(self, key, value, /): r"""Set :math:`\text{self[key]}` to a value.""" key = _get_unwrapped_index_key(key) From e008d5c95697810d1cdce15944c6fe9adc6e3580 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 10 Nov 2025 19:50:51 +0100 Subject: [PATCH 8/8] No need to override special method __subclasshook__ --- dpnp/dpnp_array.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index 5753624fac4..f3d6597bdc4 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -566,8 +566,6 @@ def __sub__(self, other, /): r"""Return :math:`\text{self - value}`.""" return dpnp.subtract(self, other) - # '__subclasshook__', - @property def __sycl_usm_array_interface__(self): """