-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add python bindings for the RNTuple backend #488
Conversation
I see very similar errors locally:
I am not sure why this doesn't work. I can instantiate a |
bda5c9a
to
fa559fd
Compare
podio-dump
support the RNTuple based backendfa559fd
to
96c3d37
Compare
This is now working for me in a local installation, and I think it should also work for a key4hep based stack. I am not entirely sure how things look like in other environments. |
root_flavor = _determine_root_format(filename) | ||
if root_flavor == RootFileFormat.TTREE: | ||
return root_io.Reader(filename) | ||
return root_io.LegacyReader(filename) | ||
if root_flavor == RootFileFormat.RNTUPLE: | ||
return root_io.RNTupleReader(filename) | ||
if root_flavor == RootFileFormat.LEGACY: | ||
return root_io.LegacyReader(filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not needed now because there aren't that many choices but all of this can be changed by a basically one liner instead of all the if - return:
return {RootFileFormat.TTREE: root_io.LegacyReader, RootFileFormat.RNTUPLE: root_io.RNTupleReader,
RootFileFormat.LEGACY: root_io.LegacyReader}[_determine_root_format(filename)](filename)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep it as it is right now, because it is easier to read, and we could think about replacing it with match
/case
once we bump our minimum python version to 3.10.
I tested it with an rntuple with EDM4hep and it worked fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for testing.
Co-authored-by: Juan Miguel Carceller <[email protected]>
Co-authored-by: Juan Miguel Carceller <[email protected]>
4ce7991
to
74da644
Compare
BEGINRELEASENOTES
podio-dump
understand RNTuple based filesENDRELEASENOTES
Tried to get this to work with spack locally, but currently stumbling over root-project/root#11797 so I cannot build podio inside spack with
ENABLE_RNTUPLE
. Curious to see in how many of our CI environments this works.