Skip to content

Commit 445f0b2

Browse files
committed
More fixes for NumPy+Blosc2 mode
1 parent 96a48be commit 445f0b2

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

bench/ndarray/fancy_index.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
NUMPY = True
2828
BLOSC = True
29-
ZARR = True
30-
HDF5 = True
29+
ZARR = False
30+
HDF5 = False
3131

3232
NDIMS = 2 # must be at least 2
3333

@@ -48,8 +48,8 @@ def genarray(r, ndims=2, verbose=True):
4848
return arr, arrsize
4949

5050

51-
target_sizes = np.int64(np.array([1, 2, 4, 8, 16, 24, 32]))
52-
# target_sizes = np.int64(np.array([1, 2, 4, 8])) # for quick testing
51+
target_sizes = np.int64(np.array([1, 2, 4, 8, 16, 24]))
52+
#target_sizes = np.int64(np.array([1, 2, 4, 8])) # for quick testing
5353
rng = np.random.default_rng()
5454
blosctimes = []
5555
nptimes = []
@@ -61,7 +61,8 @@ def genarray(r, ndims=2, verbose=True):
6161
genuine_sizes += [arrsize]
6262
idx = rng.integers(low=0, high=arr.shape[0], size=(arr.shape[0]//4,))
6363
sorted_idx = np.sort(np.unique(idx))
64-
col = np.sort(np.unique(rng.integers(low=0, high=arr.shape[0], size=(arr.shape[0]//4,))))
64+
col = rng.integers(low=0, high=arr.shape[0], size=(arr.shape[0]//4,))
65+
col_sorted = np.sort(np.unique(col))
6566
mask = rng.integers(low=0, high=2, size=(arr.shape[0],)) == 1
6667

6768
## Test fancy indexing for different use cases
@@ -89,7 +90,7 @@ def timer(arr):
8990
b = arr[idx] if not HDF5 else arr[sorted_idx]
9091
time_list += [time.time() - t]
9192
t = time.time()
92-
b = arr[m, idx] if not HDF5 else arr[m, col]
93+
b = arr[m, idx] if not HDF5 else arr[m, col_sorted]
9394
time_list += [time.time() - t]
9495
return np.array(time_list)
9596

0 commit comments

Comments
 (0)