Skip to content

Commit a8aba4e

Browse files
authored
[PyOV] Fix deprecation warnings from numpy in tests (#29170)
### Details: - From https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword: > For any __array__ method on a non-NumPy array-like object, dtype=None and copy=None keywords must be added to the signature - this will work with older NumPy versions as well ### Tickets: - *ticket-id*
1 parent e570253 commit a8aba4e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/bindings/python/tests/test_runtime/test_async_infer_request.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class ArrayLikeObject:
223223
def __init__(self, array) -> None:
224224
self.data = array
225225

226-
def __array__(self):
226+
def __array__(self, dtype=None, copy=None):
227227
return self.data
228228

229229
jobs = 8
@@ -364,7 +364,7 @@ class ArrayLikeObject:
364364
def __init__(self, array) -> None:
365365
self.data = array
366366

367-
def __array__(self):
367+
def __array__(self, dtype=None, copy=None):
368368
return np.array(self.data)
369369

370370
_, request, _, input_data = generate_abs_compiled_model_with_data(device, Type.f32, np.single)

src/bindings/python/tests/test_runtime/test_sync_infer_request.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ class ArrayLikeObject:
563563
def __init__(self, array) -> None:
564564
self.data = array
565565

566-
def __array__(self):
566+
def __array__(self, dtype=None, copy=None):
567567
return np.array(self.data)
568568

569569
_, request, _, input_data = generate_abs_compiled_model_with_data(device, Type.f32, np.single)

src/bindings/python/tests/test_utils/test_data_dispatch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class FakeTensor():
195195
def __init__(self, array):
196196
self.array = array
197197

198-
def __array__(self):
198+
def __array__(self, dtype=None, copy=None):
199199
return self.array
200200

201201

0 commit comments

Comments
 (0)