File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def plot(tree: Any) -> None: # noqa: ARG001
51
51
52
52
53
53
@plot .register
54
- def plot_branch (tree : uproot .TBranch ) -> None :
54
+ def plot_branch (tree : uproot .TBranch | uproot . models . RNTuple . RField ) -> None :
55
55
"""
56
56
Plot a single tree branch.
57
57
"""
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ def is_dir(self) -> bool:
52
52
return True
53
53
if isinstance (self .item , uproot .behaviors .TBranch .HasBranches ):
54
54
return len (self .item .branches ) > 0
55
+ if isinstance (self .item , uproot .behaviors .RNTuple .HasFields ):
56
+ return len (self .item .keys ()) > 0
55
57
return False
56
58
57
59
def meta (self ) -> MetaDict :
@@ -79,6 +81,8 @@ def children(self) -> list[UprootEntry]:
79
81
}
80
82
elif isinstance (self .item , uproot .behaviors .TBranch .HasBranches ):
81
83
items = {item .name for item in self .item .branches }
84
+ elif isinstance (self .item , uproot .behaviors .RNTuple .HasFields ):
85
+ items = self .item .keys ()
82
86
else :
83
87
items = {obj .name .split (";" )[0 ] for obj in self .item .branches }
84
88
return [
@@ -141,7 +145,7 @@ def _process_item_tfile(
141
145
142
146
143
147
@process_item .register
144
- def _process_item_ttree (uproot_object : uproot .TTree ) -> MetaDict :
148
+ def _process_item_ttree (uproot_object : uproot .TTree | uproot . behaviors . RNTuple . RNTuple ) -> MetaDict :
145
149
"""
146
150
Given an tree, return a rich.tree.Tree output.
147
151
"""
You can’t perform that action at this time.
0 commit comments