Skip to content

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

Merged
ian-sift merged 6 commits into
mainfrom
run-bound-nanosecond-timestamps
Oct 30, 2026
Merged

ian-sift merged 6 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 20a0e8a. The link may take up to a minute to become live as GitHub Pages propagates.

@ian-sift
ian-sift enabled auto-merge (squash) October 30, 2026 19:46
@ian-sift
ian-sift merged commit 000dce7 into main Oct 30, 2026
27 checks passed
@ian-sift
ian-sift deleted the run-bound-nanosecond-timestamps branch October 30, 2026 20:15
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.

2 participants