Skip to content

Commit ebab79e

Browse files
author
Luke Shaw
committed
Enable .slice method for LazyExprs
1 parent 181fef3 commit ebab79e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/ndarray/test_lazyexpr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,8 @@ def test_eval_item(array_fixture):
10661066
np.testing.assert_allclose(res[()], nres[0:10:2])
10671067

10681068

1069-
# Test stringeval with a slice
1070-
def test_stringeval_slice(array_fixture):
1069+
# Test lazyexpr's slice method
1070+
def test_eval_slice(array_fixture):
10711071
a1, a2, a3, a4, na1, na2, na3, na4 = array_fixture
10721072
expr = blosc2.lazyexpr("a1 + a2 - (a3 * a4)", operands={"a1": a1, "a2": a2, "a3": a3, "a4": a4})
10731073
nres = ne_evaluate("na1 + na2 - (na3 * na4)")[:2]
@@ -1078,6 +1078,7 @@ def test_stringeval_slice(array_fixture):
10781078
assert isinstance(res, np.ndarray)
10791079
np.testing.assert_allclose(res, nres)
10801080

1081+
# string lazy expressions automatically use .slice internally
10811082
expr1 = blosc2.lazyexpr("a1 * a2", operands={"a1": a1, "a2": a2})
10821083
expr2 = blosc2.lazyexpr("expr1[:2] + a3[:2]")
10831084
nres = ne_evaluate("(na1 * na2) + na3")[:2]

0 commit comments

Comments
 (0)