-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added kernel specializations for `awkward_ListOffsetArray_reduce…
…_local_nextparents_64` (#2572)
- Loading branch information
Showing
6 changed files
with
82 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/test_2571_awkward_ListOffsetArray_reduce_local_nextparents_64.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE | ||
|
||
import numpy as np | ||
import pytest | ||
|
||
import awkward as ak | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"indextype", [ak.index.Index32, ak.index.IndexU32, ak.index.Index64] | ||
) | ||
def test(indextype): | ||
array = ak.Array( | ||
ak.contents.ListOffsetArray( | ||
indextype(np.array([0, 3, 3, 5, 6, 9])), | ||
ak.contents.NumpyArray(np.array([6, 9, 9, 4, 4, 2, 5, 2, 7], np.int64)), | ||
) | ||
) | ||
if indextype is ak.index.Index32: | ||
assert array.layout.offsets.data.dtype == np.dtype(np.int32) | ||
elif indextype is ak.index.IndexU32: | ||
assert array.layout.offsets.data.dtype == np.dtype(np.uint32) | ||
elif indextype is ak.index.Index64: | ||
assert array.layout.offsets.data.dtype == np.dtype(np.int64) | ||
|
||
assert ak.argsort(array).tolist() == [[0, 1, 2], [], [0, 1], [0], [1, 0, 2]] |