Skip to content

Copy the recording from original sorting during NumpySorting.from_sorting()#4417

Merged
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
ecobost:sorting_w_recroding_in_analyzer
Mar 3, 2026
Merged

Copy the recording from original sorting during NumpySorting.from_sorting()#4417
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
ecobost:sorting_w_recroding_in_analyzer

Conversation

@ecobost
Copy link
Copy Markdown
Contributor

@ecobost ecobost commented Feb 28, 2026

When calling out_sorting = NumpySorting.from_sorting(sorting), out_sorting will also inherit the recording of the source.

This partly solves #4410 for the case when the analyzer is created in memory.

import spikeinterface.core.sortinganalyzer as sa

print(sorting.has_recording()) # True
analyzer = sa.create_sorting_analyzer(sorting, recording=sorting._recording)
print(analyzer.sorting.has_recording()) # True :)

print(sorting.has_recording()) # True
analyzer = sa.create_sorting_analyzer(sorting, recording=sorting._recording, format='binary_folder', folder='test_analyzer')
print(analyzer.sorting.has_recording()) # False :(

@alejoe91 alejoe91 added the core Changes to core module label Mar 3, 2026
@alejoe91 alejoe91 merged commit 4ce1622 into SpikeInterface:main Mar 3, 2026
17 of 18 checks passed
@ecobost ecobost deleted the sorting_w_recroding_in_analyzer branch March 3, 2026 00:58
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.

2 participants