Skip to content

python(fix): return run bounds as nanosecond timestamps - #857

Open
ian-sift wants to merge 4 commits into
mainfrom
run-bound-nanosecond-timestamps
Open

ian-sift wants to merge 4 commits into
mainfrom
run-bound-nanosecond-timestamps

Conversation

@ian-sift

@ian-sift ian-sift commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Run.start_time and Run.stop_time are nanosecond pandas.Timestamp values, the same resolution as channel data from get_data.
  • A time axis built from a run and read as integers now uses nanoseconds. Previously the bounds were microsecond datetime values, and interpolation against channel data filled with NaN.
  • The fields stay annotated as datetime. pandas.Timestamp is a datetime subclass, and annotating the field as Timestamp makes pydantic refuse to build the model.

Test plan

  • pytest lib/sift_client/_tests/sift_types/test_run.py covers a sub-microsecond start, an exact-second stop, unset bounds, unit == "ns", and a date_range whose integer values match the start.
  • ruff check and ruff format --check on the changed files.
  • On pandas 3.0.3, date_range of these bounds is datetime64[ns]. date_range of the old datetime bounds is datetime64[us].

A time axis built from Run.start_time used microsecond integers while channel data uses nanoseconds, so interpolation produced NaN.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-857/

Deployed from e7c78ce. The link may take up to a minute to become live as GitHub Pages propagates.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant