Skip to content

Accept arrays in BaseSorting.time_to_sample_index without a recording - #4984

Merged
alejoe91 merged 1 commit into
SpikeInterface:mainfrom
AxelNoun:fix/si-2-time-to-sample-index-array
Dec 4, 2026
Merged

alejoe91 merged 1 commit into
SpikeInterface:mainfrom
AxelNoun:fix/si-2-time-to-sample-index-array

Conversation

@AxelNoun

@AxelNoun AxelNoun commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #4960.

Without a registered recording, time_to_sample_index used the built-in round(), which fails on NumPy arrays. It now uses np.round(...).astype(np.int64), like the recording path. A scalar input now returns np.int64 instead of a Python int, which is also what the path with a registered recording returns.

@alejoe91 alejoe91 added the core Changes to core module label Dec 4, 2026
@alejoe91
alejoe91 merged commit 52be430 into SpikeInterface:main Dec 4, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BaseSorting.time_to_sample_index fails on arrays when no recording is registered

2 participants