You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let Episode.frames_at_indices accept NumPy integer indices #308
Episode.frames_at_indices() copies the requested indices, excludes Python booleans, then requires every value to satisfy isinstance(value, int).
NumPy integer scalars don't satisfy that check:
>>>isinstance(np.int64(3), int)
False
A list or array of frame indices obtained from NumPy is rejected with frame indices must be integers, even though the values are integral and HFlow already uses NumPy arrays for channel data. The existing end-to-end coverage passes only Python integers at tests/test_end_to_end.py:166-188.
Catalog timestamp normalization converts NumPy scalars to Python scalars before applying the integer and boolean rules at src/hflow/catalog.py:413-458. Keep the same normalization order here so np.bool_ doesn't become an accepted integer.
What to build
Normalize supported NumPy integer scalars before validating, sorting, hashing, and indexing the requested frames.
Definition of done
Python int, np.int32, np.int64, and unsigned NumPy integer indices are accepted when their values are valid.
bool and np.bool_ remain refused.
Floating-point values, including integral-looking values such as 3.0, remain refused.
Negative, duplicate, descending, and out-of-range indices keep their current errors.
Normalized NumPy indices produce the same extracted paths and log timestamps as equivalent Python indices.
Extend the existing exact-frame behavioral test. Don't add tests for NumPy's own conversion behavior.
No cache-key or extracted-frame layout changes.
No new dependency or transform behavior-version bump is needed.
Non-goals
Accepting fractional indices
Sorting or deduplicating caller input
Changing ffmpeg selection behavior
Changing the public return type
Validation
uv run ruff check --fix
uv run ruff format
uv run ty check
uv run pytest -q tests/test_end_to_end.py
uv run pytest -q
Activity
Sahas-Divi commentedon Aug 31, 2026
Hi, I would like to take up this issue please