Skip to content

Commit bd7e347

Browse files
committed
Update remaining manipulation tests
1 parent a5aea86 commit bd7e347

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

dpnp/tests/third_party/cupy/manipulation_tests/test_add_remove.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ def test_unique_equal_nan(self, xp, dtype, equal_nan):
314314
[[2, xp.nan, 2], [xp.nan, 1, xp.nan], [xp.nan, 1, xp.nan]],
315315
dtype=dtype,
316316
)
317-
return xp.unique(a, axis=0, equal_nan=equal_nan)
317+
return xp.unique(a, axis=1, equal_nan=equal_nan)
318318

319+
@pytest.mark.skip("unique_all() is not supported yet")
319320
@testing.with_requires("numpy>=2.0")
320321
@pytest.mark.parametrize(
321322
"attr", ["values", "indices", "inverse_indices", "counts"]
@@ -326,6 +327,7 @@ def test_unique_all(self, xp, dtype, attr):
326327
a = testing.shaped_random((100, 100), xp, dtype)
327328
return getattr(xp.unique_all(a), attr)
328329

330+
@pytest.mark.skip("unique_counts() is not supported yet")
329331
@testing.with_requires("numpy>=2.0")
330332
@pytest.mark.parametrize("attr", ["values", "counts"])
331333
@testing.for_all_dtypes(no_float16=True, no_bool=True, no_complex=True)
@@ -334,6 +336,7 @@ def test_unique_counts(self, xp, dtype, attr):
334336
a = testing.shaped_random((100, 100), xp, dtype)
335337
return getattr(xp.unique_counts(a), attr)
336338

339+
@pytest.mark.skip("unique_inverse() is not supported yet")
337340
@testing.with_requires("numpy>=2.0")
338341
@pytest.mark.parametrize("attr", ["values", "inverse_indices"])
339342
@testing.for_all_dtypes(no_float16=True, no_bool=True, no_complex=True)
@@ -342,6 +345,7 @@ def test_unique_inverse(self, xp, dtype, attr):
342345
a = testing.shaped_random((100, 100), xp, dtype)
343346
return getattr(xp.unique_inverse(a), attr)
344347

348+
@pytest.mark.skip("unique_values() is not supported yet")
345349
@testing.with_requires("numpy>=2.0")
346350
@testing.for_all_dtypes(no_float16=True, no_bool=True, no_complex=True)
347351
@testing.numpy_cupy_array_equal()

dpnp/tests/third_party/cupy/manipulation_tests/test_join.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,7 @@ def test_row_stack(self, xp, dtype1, dtype2):
533533
a = testing.shaped_arange((4, 3), xp, dtype1)
534534
b = testing.shaped_arange((3,), xp, dtype2)
535535
c = testing.shaped_arange((2, 3), xp, dtype1)
536-
with pytest.warns(DeprecationWarning):
537-
return xp.row_stack((a, b, c))
536+
return xp.row_stack((a, b, c))
538537

539538
def test_row_stack_wrong_ndim1(self):
540539
a = cupy.zeros(())

dpnp/tests/third_party/cupy/manipulation_tests/test_rearrange.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def test_roll_cupy_shift(self, xp, dtype):
4545

4646
class TestRollTypeError(unittest.TestCase):
4747

48+
@pytest.mark.skip("castable string shift is not supported")
4849
@testing.with_requires("numpy>=2.1.2")
4950
def test_roll_invalid_shift_castable(self):
5051
for xp in (numpy, cupy):
@@ -56,7 +57,7 @@ def test_roll_invalid_shift_castable(self):
5657
def test_roll_invalid_shift(self):
5758
for xp in (numpy, cupy):
5859
x = testing.shaped_arange((5, 2), xp)
59-
with pytest.raises(ValueError):
60+
with pytest.raises((ValueError, TypeError)):
6061
xp.roll(x, "a", axis=0)
6162

6263
def test_roll_invalid_axis_type(self):

dpnp/tests/third_party/cupy/manipulation_tests/test_split.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import unittest
22

3-
import dpnp as cupy
43
from dpnp.tests.third_party.cupy import testing
54

65

76
class TestSplit(unittest.TestCase):
7+
88
@testing.numpy_cupy_array_equal()
99
def test_array_split1(self, xp):
1010
a = testing.shaped_arange((3, 11), xp)

dpnp/tests/third_party/cupy/manipulation_tests/test_tiling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
{"repeats": [1, 2, 3], "axis": -2},
1818
)
1919
class TestRepeat(unittest.TestCase):
20+
2021
@testing.numpy_cupy_array_equal()
2122
def test_array_repeat(self, xp):
2223
x = testing.shaped_arange((2, 3, 4), xp)
2324
return xp.repeat(x, self.repeats, self.axis)
2425

2526

2627
class TestRepeatRepeatsNdarray(unittest.TestCase):
28+
2729
def test_func(self):
2830
a = testing.shaped_arange((2, 3, 4), cupy)
2931
repeats = cupy.array([2, 3], dtype=cupy.int32)
@@ -61,6 +63,7 @@ def test_array_repeat(self, xp):
6163
{"repeats": [1, 2, 3, 4], "axis": 0},
6264
)
6365
class TestRepeat1D(unittest.TestCase):
66+
6467
@testing.numpy_cupy_array_equal()
6568
def test_array_repeat(self, xp):
6669
x = testing.shaped_arange((4,), xp)
@@ -89,6 +92,7 @@ def test_array_repeat(self, xp):
8992
{"repeats": 2, "axis": 3},
9093
)
9194
class TestRepeatFailure(unittest.TestCase):
95+
9296
def test_repeat_failure(self):
9397
for xp in (numpy, cupy):
9498
x = testing.shaped_arange((2, 3, 4), xp)
@@ -105,6 +109,7 @@ def test_repeat_failure(self):
105109
{"reps": (2, 3, 4, 5)},
106110
)
107111
class TestTile(unittest.TestCase):
112+
108113
@testing.numpy_cupy_array_equal()
109114
def test_array_tile(self, xp):
110115
x = testing.shaped_arange((2, 3, 4), xp)
@@ -116,6 +121,7 @@ def test_array_tile(self, xp):
116121
{"reps": (-1, -2)},
117122
)
118123
class TestTileFailure(unittest.TestCase):
124+
119125
def test_tile_failure(self):
120126
for xp in (numpy, cupy):
121127
x = testing.shaped_arange((2, 3, 4), xp)

dpnp/tests/third_party/cupy/math_tests/test_arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def test_imag_complex(self, xp, dtype):
266266

267267
class ArithmeticBinaryBase:
268268

269-
@testing.numpy_cupy_allclose(atol=1e-4, type_check=has_support_aspect64())
269+
@testing.numpy_cupy_allclose(rtol=1e-4, type_check=has_support_aspect64())
270270
def check_binary(self, xp):
271271
arg1 = self.arg1
272272
arg2 = self.arg2

0 commit comments

Comments
 (0)