Skip to content

Replace int() truncation with shared ms_to_samples() #4484

Open
Antorhythms wants to merge 1 commit intoSpikeInterface:mainfrom
Antorhythms:fix-int-truncation
Open

Replace int() truncation with shared ms_to_samples() #4484
Antorhythms wants to merge 1 commit intoSpikeInterface:mainfrom
Antorhythms:fix-int-truncation

Conversation

@Antorhythms
Copy link
Copy Markdown

Utility for waveform/template sample count conversions. Adds ms_to_samples() to core_tools.py using round() instead of int() to prevent ±1 sampleinconsistencies across datasets with nearly identical sampling rates (e.g. 29999 vs 30000 Hz). Tried to spot int truncation behavior in the codebase with AI and adopted new util across 21 production files and 5 test files for all waveform/template window geometry; non-waveform conversions (margins, exclusion zones, refractory periods) left unchanged.

Fixes issue #4474

…form/template sample count conversions. Adds ms_to_samples() to core_tools.py using round() instead of int() to prevent ±1 sampleinconsistencies across datasets with nearly identical sampling rates (e.g. 29999 vs 30000 Hz). Adopted across 21 production files and 5 test files for all waveform/template window geometry; non-waveform conversions (margins, exclusion zones, refractory periods) left unchanged.
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