scikit-hep / scikit-hep/vector
Add ability to somehow map field names to coordinate axis names that vector expects
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 99
- Forks
- 42
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 6
Description
Describe the potential feature
Vector expects coordinates to have very strict names. For example to have an array with a Momentum4D behavior, the fields can be named pt, eta, phi, and mass but if pt is named "pT" for example, it's broken.
We want to have the ability to add a mapping between the fields present in the array and the coordinates that vector actually needs
Motivation
Often arrays are created directly from root files for example in coffea's schemas. And the root files may call things Pt, Eta, Phi, and Mass for example. What we now do in coffea is inside the schema to alias these branches to pt, eta, phi, and mass that vector expects. It's not a full copy as the memory is shared but it's annoting that the resulting array now has Pt and pt because vector cannot work with the former. A way to tell vector what the mapping is from field names to the names it expects would be cool.
Possible Implementation
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how vector currently interprets coordinate field names and how coffea schemas alias ROOT branches such as Pt, Eta, Phi, and Mass. Define the expected mapping behavior and its scope; the work is done when arrays using alternate field names can provide the same coordinate behavior without requiring those aliases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100