-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: interpretation for arrays of non-numerical objects issue 880 par…
…t2 (#911) * fix: interpretation for arrays of non-numerical objects issue 880 part2 * style: pre-commit fixes * Change name of test file to match PR nr. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e0cbfec
commit fcb7b14
Showing
2 changed files
with
27 additions
and
3 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
16 changes: 16 additions & 0 deletions
16
tests/test_0911-fix_interp_array_non_numerical_objs_issue_880.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,16 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE | ||
|
||
import uproot | ||
import skhep_testdata | ||
|
||
|
||
def test_fix_interpretation_for_arrays_of_nonnumerical_objects_issue_880_p2(): | ||
with uproot.open(skhep_testdata.data_path("uproot-issue-880.root")) as file: | ||
branch = file["Z/Event/Cluster[6]"] | ||
array = branch.array(library="ak") | ||
interp = uproot.interpretation.identify.interpretation_of( | ||
branch, {}, False | ||
) # AsObjects(AsArray(False, False, Model_zCluster, (6,))) | ||
|
||
assert len(array) == 116 | ||
assert len(array[0][0]) == 6 # all 6 cluster can now be accessed |