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