@@ -29,12 +29,12 @@ def bench():
29
29
x @ y
30
30
31
31
32
- def id_of_test (param ):
32
+ def get_test_id (param ):
33
33
side , rank = param
34
34
return f"{ side = } -{ rank = } "
35
35
36
36
37
- @pytest .fixture (params = itertools .product ([100 , 500 , 1000 ], [1 , 2 , 3 , 4 ]), ids = id_of_test )
37
+ @pytest .fixture (params = itertools .product ([100 , 500 , 1000 ], [1 , 2 , 3 , 4 ]), ids = get_test_id )
38
38
def elemwise_args (request , seed , max_size ):
39
39
side , rank = request .param
40
40
if side ** rank >= max_size :
@@ -77,7 +77,7 @@ def bench():
77
77
f (x , y )
78
78
79
79
80
- @pytest .fixture (params = itertools .product ([100 , 500 , 1000 ], [1 , 2 , 3 ]), ids = id_of_test )
80
+ @pytest .fixture (params = itertools .product ([100 , 500 , 1000 ], [1 , 2 , 3 ]), ids = get_test_id )
81
81
def indexing_args (request , seed , max_size ):
82
82
side , rank = request .param
83
83
if side ** rank >= max_size :
@@ -117,7 +117,7 @@ def test_index_fancy(benchmark, indexing_args, seed):
117
117
side = x .shape [0 ]
118
118
rank = x .ndim
119
119
rng = np .random .default_rng (seed = seed )
120
- index = rng .integers ((side // 2 ,) * rank )
120
+ index = rng .integers (0 , side , size = (side // 2 ,) * rank )
121
121
122
122
x [index ] # Numba compilation
123
123
0 commit comments