-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ntuple] Extend RNTupleOpenSpec
to allow creating processors from a TDirectory
#17934
base: master
Are you sure you want to change the base?
Conversation
Test Results 18 files 18 suites 4d 10h 2m 41s ⏱️ For more details on these failures, see this check. Results for commit 78c02dc. ♻️ This comment has been updated with latest results. |
3bd92d7
to
8629d5b
Compare
@@ -39,9 +39,11 @@ struct RNTupleProcessorEntryLoader; | |||
/// Used to specify the underlying RNTuples in RNTupleProcessor | |||
struct RNTupleOpenSpec { | |||
std::string fNTupleName; | |||
std::string fStorage; | |||
std::variant<std::string, TDirectory *> fStorage; |
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 think we need to discuss a bit the public interface of this. I am not sure it's going to be easily usable from Python, which might or might not be what we want.
As an alternative interface, maybe we can accept a |
I'm not very fond of that idea because 1) it would put more burden on the user and 2) I don't know to what extent that would make things nicer in Python. Of course when it turns out that this is a desired interface by users we can add it, but for now I would prefer not to extend the interface. I discussed possible solutions with @vepadulano, and ultimately we settled on making |
... and its subclasses. The option to specificy the location of an ntuple as a `TDirectory` instead of a plain file name provides more flexibility for creating `RNTupleProcessor` objects. Among others, it supports processing ntuples stored in subdirectories and `TMemFile`s.
The use of `std::variant` is not very ergonimic in Python. After discussion different solutions, it was concluded that the specification would/should not be used for anything beyond creating `RNTupleProcessor`s, and that public access to its data members is not strictly required.
8629d5b
to
78c02dc
Compare
RNTupleProcessor
from TDirectory
RNTupleOpenSpec
to allow creating processors from a TDirectory
This PR changes
RNTupleOpenSpec
to accept aTDirectory
(or one of its descendants) instead of a plain file name, and create aRNTupleProcessor
from there. This provides more flexibility for creatingRNTupleProcessor
objects. Among others, it enables processing RNTuples stored in subdirectories andTMemFile
s.One caveat is that the use of
std::variant
is not very ergonomic in Python. After discussing different solutions with @vepadulano, we concluded that the specification would/should not be used for anything beyond creatingRNTupleProcessor
s, and that public access to its data members is not strictly required. It has therefore been changed to a write-only class, and theRNTupleProcessor
creation factory arguments have been updated accordingly.