scikit-hep / scikit-hep/vector
Better support for operations on `option[Vector[...]] `
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 99
- Forks
- 42
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 6
Description
Vector Version
0.10.0
Python Version
3.10.7
OS / Environment
Linux (Ubuntu 22.04)
Conda-provisioned Python
Describe the bug
Outer options become inner-options after operations on vectors:
>>> x = vector.awk([{"x": 1, "y": 0, "z": 0}])
>>> y = vector.awk([{"x": 0, "y": 1, "z": 0}])
>>> x.cross(y).type
1 * Vector3D["x": int64, "y": int64, "z": int64]
>>> x.mask[[False]].cross(y).type
1 * Vector3D["x": ?int64, "y": ?int64, "z": ?int64]
Steps to Reproduce
Wrap a vector in an option type, and then operate on it e.g. with cross.
Expected Results
The option should survive outside the record.
Observed Results
The option moves inside the record.
Relevant log output
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 reproducing the provided Python examples with vector.awk, mask, and cross, then trace how option types are represented and propagated through vector operations. Compare the observed and expected types; done means an outer option remains outside the Vector record after operations such as cross.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100