29
29
get_float_complex_dtypes ,
30
30
get_float_dtypes ,
31
31
get_integer_dtypes ,
32
+ get_integer_float_dtypes ,
32
33
has_support_aspect16 ,
33
34
has_support_aspect64 ,
34
35
numpy_version ,
@@ -50,9 +51,7 @@ def test_angle_bool(self, deg):
50
51
# determined by Type Promotion Rules.
51
52
assert_dtype_allclose (result , expected , check_only_type_kind = True )
52
53
53
- @pytest .mark .parametrize (
54
- "dtype" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
55
- )
54
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
56
55
def test_angle (self , dtype , deg ):
57
56
ia = dpnp .arange (10 , dtype = dtype )
58
57
a = ia .asnumpy ()
@@ -134,9 +133,7 @@ def test_mode(self):
134
133
135
134
136
135
class TestClip :
137
- @pytest .mark .parametrize (
138
- "dtype" , get_all_dtypes (no_bool = True , no_none = True , no_complex = True )
139
- )
136
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
140
137
@pytest .mark .parametrize ("order" , ["C" , "F" , "A" , "K" , None ])
141
138
def test_clip (self , dtype , order ):
142
139
ia = dpnp .asarray ([[1 , 2 , 8 ], [1 , 6 , 4 ], [9 , 5 , 1 ]], dtype = dtype )
@@ -148,9 +145,7 @@ def test_clip(self, dtype, order):
148
145
assert expected .flags .c_contiguous == result .flags .c_contiguous
149
146
assert expected .flags .f_contiguous == result .flags .f_contiguous
150
147
151
- @pytest .mark .parametrize (
152
- "dtype" , get_all_dtypes (no_bool = True , no_none = True , no_complex = True )
153
- )
148
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
154
149
def test_clip_arrays (self , dtype ):
155
150
ia = dpnp .asarray ([1 , 2 , 8 , 1 , 6 , 4 , 1 ], dtype = dtype )
156
151
a = dpnp .asnumpy (ia )
@@ -162,9 +157,7 @@ def test_clip_arrays(self, dtype):
162
157
expected = numpy .clip (a , min_v .asnumpy (), max_v .asnumpy ())
163
158
assert_allclose (result , expected )
164
159
165
- @pytest .mark .parametrize (
166
- "dtype" , get_all_dtypes (no_bool = True , no_none = True , no_complex = True )
167
- )
160
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
168
161
@pytest .mark .parametrize ("in_dp" , [dpnp , dpt ])
169
162
@pytest .mark .parametrize ("out_dp" , [dpnp , dpt ])
170
163
def test_clip_out (self , dtype , in_dp , out_dp ):
@@ -302,9 +295,7 @@ def test_axis_tuple(self):
302
295
a = dpnp .ones ((3 , 4 ))
303
296
assert_raises (TypeError , dpnp .cumlogsumexp , a , axis = (0 , 1 ))
304
297
305
- @pytest .mark .parametrize (
306
- "in_dt" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
307
- )
298
+ @pytest .mark .parametrize ("in_dt" , get_integer_float_dtypes ())
308
299
@pytest .mark .parametrize ("dt" , get_all_dtypes (no_bool = True ))
309
300
def test_dtype (self , in_dt , dt ):
310
301
a = dpnp .ones (100 , dtype = in_dt )
@@ -1119,9 +1110,7 @@ def test_0d(self):
1119
1110
na = a .asnumpy ()
1120
1111
assert_dtype_allclose (dpnp .i0 (a ), numpy .i0 (na ))
1121
1112
1122
- @pytest .mark .parametrize (
1123
- "dt" , get_all_dtypes (no_bool = True , no_none = True , no_complex = True )
1124
- )
1113
+ @pytest .mark .parametrize ("dt" , get_integer_float_dtypes ())
1125
1114
def test_1d (self , dt ):
1126
1115
a = numpy .array (
1127
1116
[0.49842636 , 0.6969809 , 0.22011976 , 0.0155549 , 10.0 ], dtype = dt
@@ -1225,30 +1214,24 @@ def test_add(self, dtype, lhs, rhs):
1225
1214
def test_arctan2 (self , dtype , lhs , rhs ):
1226
1215
self ._test_mathematical ("arctan2" , dtype , lhs , rhs )
1227
1216
1228
- @pytest .mark .parametrize (
1229
- "dtype" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
1230
- )
1217
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
1231
1218
def test_copysign (self , dtype , lhs , rhs ):
1232
1219
self ._test_mathematical ("copysign" , dtype , lhs , rhs )
1233
1220
1234
1221
@pytest .mark .parametrize ("dtype" , get_all_dtypes (no_none = True ))
1235
1222
def test_divide (self , dtype , lhs , rhs ):
1236
1223
self ._test_mathematical ("divide" , dtype , lhs , rhs )
1237
1224
1238
- @pytest .mark .parametrize (
1239
- "dtype" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
1240
- )
1225
+ @pytest .mark .parametrize ("dtype" , get_all_dtypes (no_none = True ))
1241
1226
def test_fmax (self , dtype , lhs , rhs ):
1242
1227
self ._test_mathematical ("fmax" , dtype , lhs , rhs , check_type = False )
1243
1228
1244
- @pytest .mark .parametrize (
1245
- "dtype" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
1246
- )
1229
+ @pytest .mark .parametrize ("dtype" , get_all_dtypes (no_none = True ))
1247
1230
def test_fmin (self , dtype , lhs , rhs ):
1248
1231
self ._test_mathematical ("fmin" , dtype , lhs , rhs , check_type = False )
1249
1232
1250
1233
@pytest .mark .parametrize (
1251
- "dtype" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
1234
+ "dtype" , get_all_dtypes (no_none = True , no_complex = True )
1252
1235
)
1253
1236
def test_fmod (self , dtype , lhs , rhs ):
1254
1237
if rhs == 0.3 and not has_support_aspect64 ():
@@ -1276,9 +1259,7 @@ def test_floor_divide(self, dtype, lhs, rhs):
1276
1259
"floor_divide" , dtype , lhs , rhs , check_type = False
1277
1260
)
1278
1261
1279
- @pytest .mark .parametrize (
1280
- "dtype" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
1281
- )
1262
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
1282
1263
def test_hypot (self , dtype , lhs , rhs ):
1283
1264
self ._test_mathematical ("hypot" , dtype , lhs , rhs )
1284
1265
@@ -1838,12 +1819,7 @@ def test_rand(self, dt):
1838
1819
expected = numpy .unwrap (a )
1839
1820
assert_dtype_allclose (result , expected )
1840
1821
1841
- @pytest .mark .parametrize (
1842
- "dt" ,
1843
- get_all_dtypes (
1844
- no_none = True , no_bool = True , no_complex = True , no_unsigned = True
1845
- ),
1846
- )
1822
+ @pytest .mark .parametrize ("dt" , get_integer_float_dtypes (no_unsigned = True ))
1847
1823
def test_period (self , dt ):
1848
1824
a = numpy .array ([1 , 1 + 108 ], dtype = dt )
1849
1825
ia = dpnp .array (a )
@@ -1853,12 +1829,7 @@ def test_period(self, dt):
1853
1829
expected = numpy .unwrap (a , period = 107 )
1854
1830
assert_array_equal (result , expected )
1855
1831
1856
- @pytest .mark .parametrize (
1857
- "dt" ,
1858
- get_all_dtypes (
1859
- no_none = True , no_bool = True , no_complex = True , no_unsigned = True
1860
- ),
1861
- )
1832
+ @pytest .mark .parametrize ("dt" , get_integer_float_dtypes (no_unsigned = True ))
1862
1833
def test_rand_period (self , dt ):
1863
1834
a = generate_random_numpy_array (10 , dt , low = - 100 , high = 100 )
1864
1835
ia = dpnp .array (a )
@@ -2309,9 +2280,7 @@ def test_error(self, func):
2309
2280
2310
2281
2311
2282
class TestHypot :
2312
- @pytest .mark .parametrize (
2313
- "dtype" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
2314
- )
2283
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
2315
2284
def test_hypot (self , dtype ):
2316
2285
a = generate_random_numpy_array (10 , dtype , low = 0 )
2317
2286
b = generate_random_numpy_array (10 , dtype , low = 0 )
@@ -2376,9 +2345,7 @@ def test_basic(self, dtype, axis, keepdims):
2376
2345
2377
2346
assert_dtype_allclose (res , exp )
2378
2347
2379
- @pytest .mark .parametrize (
2380
- "in_dt" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
2381
- )
2348
+ @pytest .mark .parametrize ("in_dt" , get_integer_float_dtypes ())
2382
2349
@pytest .mark .parametrize ("dt" , get_all_dtypes (no_bool = True ))
2383
2350
def test_dtype (self , in_dt , dt ):
2384
2351
a = dpnp .ones (100 , dtype = in_dt )
@@ -2436,9 +2403,7 @@ def test_basic(self, dtype, axis, keepdims):
2436
2403
2437
2404
assert_dtype_allclose (res , exp )
2438
2405
2439
- @pytest .mark .parametrize (
2440
- "in_dt" , get_all_dtypes (no_none = True , no_bool = True , no_complex = True )
2441
- )
2406
+ @pytest .mark .parametrize ("in_dtype" , get_integer_float_dtypes ())
2442
2407
@pytest .mark .parametrize ("dt" , get_all_dtypes (no_bool = True ))
2443
2408
def test_dtype (self , in_dt , dt ):
2444
2409
a = dpnp .ones (99 , dtype = in_dt )
@@ -2467,9 +2432,7 @@ def test_out(self, in_dt, out_dt):
2467
2432
assert_allclose (result , exp , rtol = 1e-06 )
2468
2433
2469
2434
2470
- @pytest .mark .parametrize (
2471
- "dtype" , get_all_dtypes (no_bool = True , no_none = True , no_complex = True )
2472
- )
2435
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
2473
2436
def test_inplace_remainder (dtype ):
2474
2437
size = 21
2475
2438
a = numpy .arange (size , dtype = dtype )
@@ -2481,9 +2444,7 @@ def test_inplace_remainder(dtype):
2481
2444
assert_allclose (ia , a )
2482
2445
2483
2446
2484
- @pytest .mark .parametrize (
2485
- "dtype" , get_all_dtypes (no_bool = True , no_none = True , no_complex = True )
2486
- )
2447
+ @pytest .mark .parametrize ("dtype" , get_integer_float_dtypes ())
2487
2448
def test_inplace_floor_divide (dtype ):
2488
2449
size = 21
2489
2450
a = numpy .arange (size , dtype = dtype )
0 commit comments