Skip to content

Specify leaves programtically #124

@gordonwatts

Description

@gordonwatts

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions