From 842b51e17e364cc31d670fdf93407ddf7326aaff Mon Sep 17 00:00:00 2001 From: tess <48131946+stress-tess@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:20:45 -0400 Subject: [PATCH] Fixes #3821: Bug in stridable indexing of Strings in multilocale (#3830) * Fixes #3821: Bug in stridable indexing of Strings in multilocale This PR fixes #3821 which gave incorrect results for stridable index into segstrngs on multilocale * remove test skip --------- Co-authored-by: Tess Hayes Co-authored-by: ajpotts --- src/SegmentedString.chpl | 4 +--- tests/numpy/manipulation_functions_test.py | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/SegmentedString.chpl b/src/SegmentedString.chpl index 23862d73b8..8661313772 100644 --- a/src/SegmentedString.chpl +++ b/src/SegmentedString.chpl @@ -207,9 +207,7 @@ module SegmentedString { proc this(const slice: range(strides=strideKind.any)) throws { var aa = makeDistArray(slice.size, int); - forall (elt,j) in zip(aa, slice) with (var agg = newSrcAggregator(int)) { - agg.copy(elt,j); - } + aa = slice; return this[aa]; } diff --git a/tests/numpy/manipulation_functions_test.py b/tests/numpy/manipulation_functions_test.py index 301e07af20..83a534cc8d 100644 --- a/tests/numpy/manipulation_functions_test.py +++ b/tests/numpy/manipulation_functions_test.py @@ -40,8 +40,6 @@ def test_flip_multi_dim_bool(self, size): f2 = ak.broadcast(segments=segs, values=vals2, permutation=perm).reshape(shape) assert_equal(f, f2) - # Currently there is a bug in the reverse indexing of Strings (#3821) that causes this test to fail. - @pytest.mark.skip("Skip until bug fix Ticket #3821 is completed.") @pytest.mark.parametrize("size", pytest.prob_size) def test_flip_string(self, size): s = ak.random_strings_uniform(1, 2, size, seed=seed)