Skip to content

Commit 8ad16ff

Browse files
committed
Remove names from test_elementwise_functions that are in test_type_promotion
1 parent 00fa703 commit 8ad16ff

File tree

1 file changed

+6
-59
lines changed

1 file changed

+6
-59
lines changed

array_api_tests/test_elementwise_functions.py

Lines changed: 6 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
logical_or, logical_and, inrange, π, one, zero,
3232
infinity, full, isnegzero, isnegative, any as
3333
array_any, int_to_dtype, bool as bool_dtype)
34-
from .test_type_promotion import dtype_nbits, dtype_signed
3534

3635
from . import _array_module
3736

@@ -62,64 +61,6 @@ def sanity_check(x1, x2):
6261
if (t1, t2) not in promotion_table:
6362
raise RuntimeError("Error in test generation (probably a bug in the test suite")
6463

65-
input_types = {
66-
'abs': 'numeric',
67-
'acos': 'floating',
68-
'acosh': 'floating',
69-
'add': 'numeric',
70-
'asin': 'floating',
71-
'asinh': 'floating',
72-
'atan': 'floating',
73-
'atan2': 'floating',
74-
'atanh': 'floating',
75-
'bitwise_and': 'integer_or_boolean',
76-
'bitwise_invert': 'integer_or_boolean',
77-
'bitwise_left_shift': 'integer',
78-
'bitwise_or': 'integer_or_boolean',
79-
'bitwise_right_shift': 'integer',
80-
'bitwise_xor': 'integer_or_boolean',
81-
'ceil': 'numeric',
82-
'cos': 'floating',
83-
'cosh': 'floating',
84-
'divide': 'floating',
85-
'equal': 'any',
86-
'exp': 'floating',
87-
'expm1': 'floating',
88-
'floor': 'numeric',
89-
'floor_divide': 'numeric',
90-
'greater': 'numeric',
91-
'greater_equal': 'numeric',
92-
'isfinite': 'numeric',
93-
'isinf': 'numeric',
94-
'isnan': 'numeric',
95-
'less': 'numeric',
96-
'less_equal': 'numeric',
97-
'log': 'floating',
98-
'log10': 'floating',
99-
'log1p': 'floating',
100-
'log2': 'floating',
101-
'logical_and': 'boolean',
102-
'logical_not': 'boolean',
103-
'logical_or': 'boolean',
104-
'logical_xor': 'boolean',
105-
'multiply': 'numeric',
106-
'negative': 'numeric',
107-
'not_equal': 'any',
108-
'positive': 'numeric',
109-
'pow': 'floating',
110-
'remainder': 'numeric',
111-
'round': 'numeric',
112-
'sign': 'numeric',
113-
'sin': 'floating',
114-
'sinh': 'floating',
115-
'sqrt': 'floating',
116-
'square': 'numeric',
117-
'subtract': 'numeric',
118-
'tan': 'floating',
119-
'tanh': 'floating',
120-
'trunc': 'numeric',
121-
}
122-
12364
@given(numeric_scalars)
12465
def test_abs(x):
12566
a = _array_module.abs(x)
@@ -248,6 +189,7 @@ def test_atanh(x):
248189

249190
@given(two_integer_or_boolean_dtypes.flatmap(lambda i: two_array_scalars(*i)))
250191
def test_bitwise_and(args):
192+
from .test_type_promotion import dtype_nbits, dtype_signed
251193
x1, x2 = args
252194
sanity_check(x1, x2)
253195
a = _array_module.bitwise_and(x1, x2)
@@ -266,6 +208,7 @@ def test_bitwise_and(args):
266208

267209
@given(two_integer_dtypes.flatmap(lambda i: two_array_scalars(*i)))
268210
def test_bitwise_left_shift(args):
211+
from .test_type_promotion import dtype_nbits, dtype_signed
269212
x1, x2 = args
270213
sanity_check(x1, x2)
271214
negative_x2 = isnegative(x2)
@@ -289,6 +232,7 @@ def test_bitwise_left_shift(args):
289232

290233
@given(integer_or_boolean_scalars)
291234
def test_bitwise_invert(x):
235+
from .test_type_promotion import dtype_nbits, dtype_signed
292236
a = _array_module.bitwise_invert(x)
293237
# Compare against the Python ~ operator.
294238
# TODO: Generalize this properly for inputs that are arrays.
@@ -304,6 +248,7 @@ def test_bitwise_invert(x):
304248

305249
@given(two_integer_or_boolean_dtypes.flatmap(lambda i: two_array_scalars(*i)))
306250
def test_bitwise_or(args):
251+
from .test_type_promotion import dtype_nbits, dtype_signed
307252
x1, x2 = args
308253
sanity_check(x1, x2)
309254
a = _array_module.bitwise_or(x1, x2)
@@ -322,6 +267,7 @@ def test_bitwise_or(args):
322267

323268
@given(two_integer_dtypes.flatmap(lambda i: two_array_scalars(*i)))
324269
def test_bitwise_right_shift(args):
270+
from .test_type_promotion import dtype_nbits, dtype_signed
325271
x1, x2 = args
326272
sanity_check(x1, x2)
327273
negative_x2 = isnegative(x2)
@@ -340,6 +286,7 @@ def test_bitwise_right_shift(args):
340286

341287
@given(two_integer_or_boolean_dtypes.flatmap(lambda i: two_array_scalars(*i)))
342288
def test_bitwise_xor(args):
289+
from .test_type_promotion import dtype_nbits, dtype_signed
343290
x1, x2 = args
344291
sanity_check(x1, x2)
345292
a = _array_module.bitwise_xor(x1, x2)

0 commit comments

Comments
 (0)