-
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.
Browse files
Browse the repository at this point in the history
* Reordered nextparents to be monotonic (in v2), but this isn't right. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [skip-ci] add a 4d study case * Fix: use mergesort, which is stable for like elements * This fixes the typetracer failures. * Fix: use `stable` instead of `mergesort` `stable` is the proper option for this requirement. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ianna Osborne <ianna.osborne@cern.ch> Co-authored-by: Angus Hollands <goosey15@gmail.com>
- Loading branch information
1 parent
1b52320
commit d0b383f
Showing
4 changed files
with
106 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE | ||
|
||
import pytest # noqa: F401 | ||
import numpy as np # noqa: F401 | ||
import awkward as ak # noqa: F401 | ||
|
||
|
||
def test(): | ||
akarray = ak._v2.highlevel.Array( | ||
[[[[1], [4]], [[5], [8]]], [[[9], [12]], [[13], [16]]]] | ||
) | ||
nparray = np.array([[[[1], [4]], [[5], [8]]], [[[9], [12]], [[13], [16]]]]) | ||
|
||
assert ak._v2.sum(akarray, axis=3).tolist() == np.sum(nparray, axis=3).tolist() | ||
assert ak._v2.sum(akarray, axis=2).tolist() == np.sum(nparray, axis=2).tolist() | ||
assert ak._v2.sum(akarray, axis=1).tolist() == np.sum(nparray, axis=1).tolist() | ||
assert ak._v2.sum(akarray, axis=0).tolist() == np.sum(nparray, axis=0).tolist() |