@@ -295,9 +295,9 @@ def test_oindex():
295295def test_findex ():
296296 # Test 1d fast path
297297 ndim = 1
298- d = 100
298+ d = 1 + int ( blosc2 . MAX_FAST_PATH_SIZE / 8 ) # just over fast path size
299299 shape = (d ,) * ndim
300- arr = blosc2 .linspace (0 , 100 , num = np .prod (shape ), shape = shape , dtype = "i4" )
300+ arr = blosc2 .linspace (0 , 100 , num = np .prod (shape ), shape = shape , dtype = np . float64 )
301301 rng = np .random .default_rng ()
302302 idx = rng .integers (low = 0 , high = d , size = (d // 4 ,))
303303 nparr = arr [:]
@@ -306,11 +306,11 @@ def test_findex():
306306 np .testing .assert_allclose (b , n )
307307
308308 ndim = 3
309- d = 100
309+ d = 1 + int (( blosc2 . MAX_FAST_PATH_SIZE / 8 ) ** ( 1 / ndim )) # just over fast path size
310310 shape = (d ,) * ndim
311- arr = blosc2 .linspace (0 , 100 , num = np .prod (shape ), shape = shape , dtype = "i4" )
311+ arr = blosc2 .linspace (0 , 100 , num = np .prod (shape ), shape = shape , dtype = np . float64 )
312312 rng = np .random .default_rng ()
313- idx = rng .integers (low = 0 , high = d , size = (d ,))
313+ idx = rng .integers (low = 0 , high = d , size = (100 ,))
314314
315315 row = idx
316316 col = rng .permutation (idx )
@@ -350,11 +350,11 @@ def test_findex():
350350 # Transposition test (3rd example is transposed)
351351 b1 = arr [:, [0 , 1 ], 0 ]
352352 b2 = arr [[0 , 1 ], 0 , :]
353- b3 = arr [0 , :, [0 , 1 ]]
354353 n1 = nparr [:, [0 , 1 ], 0 ]
355354 n2 = nparr [[0 , 1 ], 0 , :]
356- n3 = nparr [0 , :, [0 , 1 ]]
357- print (b3 .shape )
358355 np .testing .assert_allclose (b1 , n1 )
359356 np .testing .assert_allclose (b2 , n2 )
360- np .testing .assert_allclose (b3 , n3 )
357+ # TODO: Support array indices separate by slices
358+ # b3 = arr[0, :, [0, 1]]
359+ # n3 = nparr[0, :, [0, 1]]
360+ # np.testing.assert_allclose(b3, n3)
0 commit comments