Skip to content
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

Specify leaves programtically #124

Open
gordonwatts opened this issue Jun 11, 2023 · 0 comments
Open

Specify leaves programtically #124

gordonwatts opened this issue Jun 11, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@gordonwatts
Copy link
Member

This was brought up in an iris-hep slack conversation by @alexander-held :

Is there a built-in way to do a shorthand if I want to Select a ton of columns at the same time and they relate in a straightforward way to my input file? Imagine something like this

Select(lambda e: {"el_pt": e.el_pt, "el_eta": e.el_eta, "el_phi": e.el_phi, ...})

which might keep going for another few tens of columns. I haven’t tried it, but perhaps some kind of

lambda e: {branch: getattr(e, branch) for branch in ["el_pt", "el_eta", "el_phi"]}

construction could do that? And if so, would it perhaps make sense to streamline this into something convenient?

@gordonwatts gordonwatts added the enhancement New feature or request label Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant