26
26
# mypy: disable-error-code=no-untyped-usage
27
27
28
28
29
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no expand_dims" )
29
+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no expand_dims" )
30
30
class TestAtLeastND :
31
31
def test_0D (self , xp : ModuleType ):
32
32
x = xp .asarray (1.0 )
@@ -98,7 +98,7 @@ def test_xp(self, xp: ModuleType):
98
98
xp_assert_equal (y , x )
99
99
100
100
101
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no isdtype" )
101
+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no isdtype" )
102
102
class TestCov :
103
103
def test_basic (self , xp : ModuleType ):
104
104
xp_assert_close (
@@ -137,15 +137,17 @@ def test_device(self, xp: ModuleType, device: Device):
137
137
x = xp .asarray ([1 , 2 , 3 ], device = device )
138
138
assert get_device (cov (x )) == device
139
139
140
- @pytest .mark .skip_xp_backend (Backend .NUMPY_READONLY )
140
+ @pytest .mark .skip_xp_backend (
141
+ Backend .NUMPY_READONLY , reason = "numpy_readonly:explicit xp"
142
+ )
141
143
def test_xp (self , xp : ModuleType ):
142
144
xp_assert_close (
143
145
cov (xp .asarray ([[0.0 , 2.0 ], [1.0 , 1.0 ], [2.0 , 0.0 ]]).T , xp = xp ),
144
146
xp .asarray ([[1.0 , - 1.0 ], [- 1.0 , 1.0 ]], dtype = xp .float64 ),
145
147
)
146
148
147
149
148
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no device" )
150
+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no device kwarg in asarray " )
149
151
class TestCreateDiagonal :
150
152
def test_1d (self , xp : ModuleType ):
151
153
# from np.diag tests
@@ -191,10 +193,10 @@ def test_xp(self, xp: ModuleType):
191
193
xp_assert_equal (y , xp .asarray ([[1 , 0 ], [0 , 2 ]]))
192
194
193
195
194
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no sparse. expand_dims" )
196
+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no expand_dims" )
195
197
class TestExpandDims :
196
- @pytest .mark .skip_xp_backend (Backend .DASK_ARRAY , reason = "tuple index out of range" )
197
- @pytest .mark .skip_xp_backend (Backend .TORCH , reason = "tuple index out of range" )
198
+ @pytest .mark .skip_xp_backend (Backend .DASK , reason = "dask: tuple index out of range" )
199
+ @pytest .mark .skip_xp_backend (Backend .TORCH , reason = "torch: tuple index out of range" )
198
200
def test_functionality (self , xp : ModuleType ):
199
201
def _squeeze_all (b : Array ) -> Array :
200
202
"""Mimics `np.squeeze(b)`. `xpx.squeeze`?"""
@@ -252,7 +254,7 @@ def test_xp(self, xp: ModuleType):
252
254
assert y .shape == (1 , 1 , 1 , 3 )
253
255
254
256
255
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no sparse. expand_dims" )
257
+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no expand_dims" )
256
258
class TestKron :
257
259
def test_basic (self , xp : ModuleType ):
258
260
# Using 0-dimensional array
@@ -349,7 +351,9 @@ def test_xp(self, xp: ModuleType):
349
351
xp_assert_equal (nunique (a , xp = xp ), xp .asarray (3 ))
350
352
351
353
352
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no arange, no device" )
354
+ @pytest .mark .skip_xp_backend (
355
+ Backend .SPARSE , reason = "sparse:no arange, no device kwarg in asarray"
356
+ )
353
357
class TestPad :
354
358
def test_simple (self , xp : ModuleType ):
355
359
a = xp .arange (1 , 4 )
@@ -399,8 +403,8 @@ def test_list_of_tuples_width(self, xp: ModuleType):
399
403
assert padded .shape == (4 , 4 )
400
404
401
405
402
- @pytest .mark .skip_xp_backend (Backend .DASK_ARRAY , reason = "no argsort" )
403
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no device" )
406
+ @pytest .mark .skip_xp_backend (Backend .DASK , reason = "dask: no argsort" )
407
+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no device kwarg in asarray " )
404
408
class TestSetDiff1D :
405
409
@pytest .mark .skip_xp_backend (
406
410
Backend .TORCH , reason = "index_select not implemented for uint32"
@@ -436,7 +440,9 @@ def test_device(self, xp: ModuleType, device: Device):
436
440
x2 = xp .asarray ([2 , 3 , 4 ], device = device )
437
441
assert get_device (setdiff1d (x1 , x2 )) == device
438
442
439
- @pytest .mark .skip_xp_backend (Backend .NUMPY_READONLY )
443
+ @pytest .mark .skip_xp_backend (
444
+ Backend .NUMPY_READONLY , reason = "numpy_readonly:explicit xp"
445
+ )
440
446
def test_xp (self , xp : ModuleType ):
441
447
x1 = xp .asarray ([3 , 8 , 20 ])
442
448
x2 = xp .asarray ([2 , 3 , 4 ])
@@ -445,7 +451,7 @@ def test_xp(self, xp: ModuleType):
445
451
xp_assert_equal (actual , expected )
446
452
447
453
448
- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no isdtype" )
454
+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no isdtype" )
449
455
class TestSinc :
450
456
def test_simple (self , xp : ModuleType ):
451
457
xp_assert_equal (sinc (xp .asarray (0.0 )), xp .asarray (1.0 ))
0 commit comments