2626
2727NUMPY = True
2828BLOSC = True
29- ZARR = True
30- HDF5 = True
29+ ZARR = False
30+ HDF5 = False
3131
3232NDIMS = 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
5353rng = np .random .default_rng ()
5454blosctimes = []
5555nptimes = []
@@ -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