Replies: 2 comments 2 replies
-
I spoke too soon. When trying to address specific indices, it fails again:
Slicing does work for another file I have though: test.root.zip
|
Beta Was this translation helpful? Give feedback.
-
Full paths or relative paths are not the issue: what it's trying to do here is load the whole The nested path names (with >>> uproot.open("/mnt/storage/data/misc/Event.root")["T"].arrays(
... ["fTracks.fYfirst[..., :0]"],
... filter_name="event/fTracks/fTracks.fYfirst")
<Array [{'fTracks.fYfirst[..., :0]': [, ... ] type='1000 * {"fTracks.fYfirst[......'> or you could hide that unwieldy field name as an alias (which work just like ROOT's built-in fAliases): >>> uproot.open("/mnt/storage/data/misc/Event.root")["T"].arrays(
... ["first"],
... filter_name="event/fTracks/fTracks.fYfirst",
... aliases={"first": "fTracks.fYfirst[..., :0]"})
<Array [{first: []}, ... {first: []}] type='1000 * {"first": var * float32}'> Also, if you're after just one branch, you can navigate to that branch explicitly and avoid all this searching and renaming. >>> uproot.open("/mnt/storage/data/misc/Event.root")["T/event/fTracks/fTracks.fYfirst"].array()[..., :0]
<Array [[], [], [], [], ... [], [], [], []] type='1000 * var * float32'> Now I'm wondering if you really meant to slice it with " I don't see a bug here, and the above would be good for everybody to know, so I'm going to make this a Discussion. If I'm wrong and there's still a bug, open a new Issue. (Unfortunately, we can't turn Discussions back into Issues, but a second iteration on your problem would likely be more specific, anyway, justifying a new Issue.) |
Beta Was this translation helpful? Give feedback.
-
Hello, I am currently testing uproot4 functions with the Histoprint command line tool. In uproot3, one could load branches without specifying the full path. In uproot4 that does not seem to be possible.
This used to work with uproot3. It also does work with uproot4 when explicitly providing the full path to the variable:
Not the additional
/fTracks
.Easy to fix by providing the full paths, but I am not sure whether this is expected behaviour.
Beta Was this translation helpful? Give feedback.
All reactions