-
Notifications
You must be signed in to change notification settings - Fork 120
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
Allow users to supply more metadata, and pass it to executors. #502
Conversation
@nsmith- take a look. Lemme know if there's a better place to put things. |
also @alexander-held this is what you were more or less asking for right? |
Yes, this looks exactly like what I had in mind. Thanks for the work on this! |
Cool, could you give this branch a try and see if you immediately run into some problem? |
I gave this a try and it worked as expected. I find this quite useful for bookkeeping, as it allows me to gather metadata in one central place as opposed to having to pass it through the processor constructor. |
@nsmith- you ok with the hacky version for now? |
Can we encapsulate the metadata instead of putting it at top level at least? fileset = {
"mydataset": {
"files": ["blah.root"],
"metadata": {"thing1": 1},
}
} |
Sure, had been on the fence about it. Makes some things cleaner too. |
I guess the access would still be |
Right, in that sense it is a little confusing since dataset is set (presumably if "dataset" were specified in the metadata it would override the current value?) |
can just make dataset a protected name... |
@nsmith- this look ok-enough for you? Now you do: filelist = {
"DummyBad": {"treename": "Events", "files": [osp.abspath("tests/samples/non_existent.root")]},
"ZJets": {"treename": "Events", "files": [osp.abspath("tests/samples/nano_dy.root")],
"metadata": {"checkusermeta": True, "someusermeta": "hello"} },
"Data" : {"treename": "Events", "files": [osp.abspath("tests/samples/nano_dimuon.root")],
"metadata": {"checkusermeta": True, "someusermeta2": "world"} }
} and it will complain at you if you try to use any reserved words. |
I gave this a try, it worked as expected. One minor suggestion: In the error message
it might be useful to include "metadata"? Otherwise it may sound as if the top-level |
@nsmith- good from your side? |
Fixes #479
Still a bit of a WIP.
At the very least this implementation does pass the metadata to the processors correctly.