-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
fix: support RNTuples with multiple cluster groups (#1359)
* Support RNTuples with multiple cluster groups * Fixed tests * Added new test for multiple cluster groups
Showing
4 changed files
with
51 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE | ||
|
||
import pytest | ||
import skhep_testdata | ||
|
||
import uproot | ||
|
||
|
||
def test_multiple_cluster_groups(): | ||
filename = skhep_testdata.data_path( | ||
"test_multiple_cluster_groups_rntuple_v1-0-0-0.root" | ||
) | ||
with uproot.open(filename) as f: | ||
obj = f["ntuple"] | ||
|
||
assert len(obj.footer.cluster_group_records) == 3 | ||
|
||
assert obj.footer.cluster_group_records[0].num_clusters == 5 | ||
assert obj.footer.cluster_group_records[1].num_clusters == 4 | ||
assert obj.footer.cluster_group_records[2].num_clusters == 3 | ||
|
||
assert obj.num_entries == 1000 | ||
|
||
arrays = obj.arrays() | ||
|
||
assert arrays.one.tolist() == list(range(1000)) | ||
assert arrays.int_vector.tolist() == [[i, i + 1] for i in range(1000)] |
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