-
Hi, I have just installed uproot, but I can't get it to read a tree. My code is very simple: import uproot
f = uproot.reading.open("myfile.root")
t = f.get("aTree")
t['TheOnlyBranch'].array() This just crashes with this stacktrace:
The branch does contain subbranches, some of them are of type Am I doing anything wrong or is this a bug to be reported? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
do you have a sample file? |
Beta Was this translation helpful? Give feedback.
-
Thanks for (privately) sending the file! As you noticed when you sent it to me, empty TTrees fail with
and that is the fundamental error. When executed in The AwkwardForth code that was generated is not correct because the So the issue here is just that the above error message didn't happen sooner. The zero-entry TTrees got to the point where this error is shown because they had nothing to deserialize and didn't error-out there. Sorry, but I'm deleting your file now, so that I don't mistakenly post it publicly in the future. |
Beta Was this translation helpful? Give feedback.
Thanks for (privately) sending the file! As you noticed when you sent it to me, empty TTrees fail with
and that is the fundamental error. When executed in
library="np"
(arbitrary Python objects in NumPy arrays), it goes through read_object_any, which deserializes a pointer type in C++, which could be a polymorphic class (which could be a union type in Awkward Array if we knew the set of possible types, which we don't) and could have reference cycles (Awkward Arrays are s…