Skip to content

Add gap_tolerance_ms API to Neuralynx reader#1822

Open
h-mayorquin wants to merge 1 commit intoNeuralEnsemble:masterfrom
h-mayorquin:fix_oversegmentation_neuralynx
Open

Add gap_tolerance_ms API to Neuralynx reader#1822
h-mayorquin wants to merge 1 commit intoNeuralEnsemble:masterfrom
h-mayorquin:fix_oversegmentation_neuralynx

Conversation

@h-mayorquin
Copy link
Contributor

Adds the gap_tolerance_ms parameter to NeuralynxRawIO and NeuralynxIO, following the pattern established by the Blackrock reader in #1789. When gaps are detected and no tolerance is set, a ValueError is raised with a detailed gap report. When a tolerance is provided, the data is automatically segmented at gaps exceeding that threshold. The old strict_gap_mode parameter is deprecated with a warning. By default (gap_tolerance_ms=None), only gaps of at least one sample period are reported as errors; sub-sample timestamp deviations from rounding or clock jitter are silently ignored.

A _get_neuralynx_timestamps() method exposes the original per-record hardware timestamps in microseconds, giving users access to the raw timing information for drift analysis or precise alignment with external systems.

The test infrastructure gains rawio_kwargs on BaseTestRawIO and io_kwargs on BaseTestIO, allowing any format's tests to pass constructor arguments without overriding test methods or subclassing the IO class.

@h-mayorquin h-mayorquin self-assigned this Feb 18, 2026
@samuelgarcia
Copy link
Contributor

This is heroic!
I will try to have a look soon ! ( i am a lier )

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

Comments