scikit-hep / scikit-hep/vector

Better support for operations on `option[Vector[...]] `

Open
#283 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.