Skip to content

feat: expose native SpikeGadgets timestamps privately - #1949

Draft
DanceoftheAurora wants to merge 2 commits into
NeuralEnsemble:masterfrom
DanceoftheAurora:feat/spikegadgets-native-timestamps
Draft

DanceoftheAurora wants to merge 2 commits into
NeuralEnsemble:masterfrom
DanceoftheAurora:feat/spikegadgets-native-timestamps

Conversation

@DanceoftheAurora

Copy link
Copy Markdown

SpikeGadgets packets contain a uint32 acquisition tick that callers currently cannot retrieve through a timestamp accessor. This draft adds _get_spikegadgets_timestamps(i_start=None, i_stop=None), returning a read-only view of the stored little-endian ticks. For example, [100, 101, 103, 104] remains exactly that sequence, so a downstream caller can inspect the missing tick directly.

This is the accessor step of #1856, following the private-accessor precedent in #1816 and the native-format direction in #1773. Tick values retain their original units, initial value, gaps, rollovers and resets. The method uses Intan's optional slice arguments; SpikeGadgets currently has one block and one segment, with one packet tick shared by its signal streams. The name and signature remain private while the common timestamp API is being developed.

Continuity detection and gap handling remain future work: parsing, nominal signal times and segmentation keep their current behavior. This PR therefore does not resolve #1856's silent timing problem. It provides the native data needed for that work without adding an unused validator or a new read option.

Validation on macOS arm64, Python 3.12.14 and NumPy 2.5.4:

  • Synthetic tests cover exact uint32 values, ordinary and discontinuous sequences, wrap/reset preservation, slices, shared read-only memory, empty recordings and auxiliary bytes before timestamps.
  • Focused SpikeGadgets tests: 3 passed, 11 skipped, 10 subtests passed. The skips are existing tests requiring external fixtures.
  • Offline core tests and RawIO lookup tests: 648 passed, 16 skipped.
  • An additional independent synthetic probe covered 19 file layouts/cases and 150 slices, including different device-byte offsets and signal-stream selections.
  • Black and git diff --check passed. Windows was not available locally; synthetic-test cleanup explicitly closes mappings before deleting files.

Prepared with AI assistance; the synthetic fixtures and reported checks were run locally. No external recordings were downloaded for this change.

Return a read-only uint32 packet-tick view with slice bounds. Preserve native starts, gaps, rollover and resets; signal timing and parse behavior are unchanged.

Add generated-file tests and contributor attribution. AI-assisted implementation; focused and offline core/RawIO tests executed. Partial step toward NeuralEnsemble#1856.
Retain both author entries in the sole manual conflict. Accessor implementation and tests are unchanged.

Validation: 3 focused tests and 10 subtests pass with Python 3.11.16 and NumPy 2.4.6.

Prepared with AI assistance.

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.

SpikeGadgetsRawIO: detect timestamp gaps and expose acquisition timestamps (impl of #1773)

1 participant