Skip to content

Commit 3063959

Browse files
committed
Avoid the use of blosc2.linspace because it is too heavy
1 parent 98b2477 commit 3063959

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/ndarray/test_reductions.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,14 @@ def test_fast_path(chunks, blocks, disk, fill_value, reduce_op, axis):
439439
assert np.allclose(res, nres)
440440

441441
# Try with a slice
442-
b = blosc2.linspace(0, 1, blocks=blocks, chunks=chunks, shape=shape, dtype=a.dtype)
443-
nb = b[:]
444442
slice_ = (slice(5, 7),)
445443
if reduce_op in {"cumulative_sum", "cumulative_prod"}:
446444
axis = 0 if axis is None else axis
447445
oploc = "npcumsum" if reduce_op == "cumulative_sum" else "npcumprod"
448-
nres = eval(f"{oploc}((na + nb)[{slice_}], axis={axis})")
446+
nres = eval(f"{oploc}((na - .1)[{slice_}], axis={axis})")
449447
else:
450-
nres = getattr((na + nb)[slice_], reduce_op)(axis=axis)
451-
res = getattr(a + b, reduce_op)(axis=axis, item=slice_)
448+
nres = getattr((na - 0.1)[slice_], reduce_op)(axis=axis)
449+
res = getattr(a - 0.1, reduce_op)(axis=axis, item=slice_)
452450
assert np.allclose(res, nres)
453451

454452

0 commit comments

Comments
 (0)