Skip to content

Commit 9216721

Browse files
committed
Comment that outlines parametrisation behaviour
1 parent 27a2835 commit 9216721

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

array_api_tests/test_elementwise_functions.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@
2929
# We might as well use this implementation rather than xp.broadcast_shapes()
3030
from .test_broadcasting import broadcast_shapes
3131

32+
33+
# When appropiate, this module tests operators alongside their respective
34+
# elementwise methods. We do this by parametrizing a generalised test method
35+
# with every relevant method and operator. Notably each parameter includes a
36+
# function object, which for operator test cases is a wrapper that allows test
37+
# logic to be generalised.
38+
39+
3240
func_to_op = {v: k for k, v in dh.op_to_func.items()}
41+
all_op_to_symbol = {**dh.binary_op_to_symbol, **dh.inplace_op_to_symbol}
42+
finite_kw = {"allow_nan": False, "allow_infinity": False}
3343

3444
unary_argnames = ("func_name", "func", "strat")
3545
UnaryParam = Param[str, Callable[[Array], Array], st.SearchStrategy[Array]]
@@ -48,9 +58,6 @@ def make_unary_params(
4858
]
4959

5060

51-
all_op_to_symbol = {**dh.binary_op_to_symbol, **dh.inplace_op_to_symbol}
52-
finite_kw = {"allow_nan": False, "allow_infinity": False}
53-
5461
binary_argnames = (
5562
"func_name",
5663
"func",

0 commit comments

Comments
 (0)