Skip to content

Commit edf1f86

Browse files
committed
changed rank to use ndim
1 parent 812e239 commit edf1f86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

benchmarks/test_benchmark_coo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def indexing_args(request, seed, max_size):
9191
def test_index_scalar(benchmark, indexing_args):
9292
x = indexing_args
9393
side = x.shape[0]
94-
rank = len(x.shape)
94+
rank = x.ndim
9595

9696
x[(side // 2,) * rank] # Numba compilation
9797

@@ -103,7 +103,7 @@ def bench():
103103
def test_index_slice(benchmark, indexing_args):
104104
x = indexing_args
105105
side = x.shape[0]
106-
rank = len(x.shape)
106+
rank = x.ndim
107107

108108
x[(slice(side // 2),) * rank] # Numba compilation
109109

@@ -115,7 +115,7 @@ def bench():
115115
def test_index_fancy(benchmark, indexing_args, seed):
116116
x = indexing_args
117117
side = x.shape[0]
118-
rank = len(x.shape)
118+
rank = x.ndim
119119
rng = np.random.default_rng(seed=seed)
120120
index = rng.integers((side // 2,) * rank)
121121

0 commit comments

Comments
 (0)