Skip to content

SortingAnalyzer recording / sorting segments match #4372

@pas-calc

Description

@pas-calc

In earlier versions of SpikeInterface, the SortingAnalyzer's recording's and sorting's number of segments did not need to match.
For example, we were recording for several trials and having several recording files. We give the merged (concatenated cat) file to our favorite spike sorter. We get a sorting result out in global times.

Creating a SortingAnalyzer
calls

if has_exceeding_spikes(sorting=sorting, recording=recording):

which does

assert (
sorting.get_num_segments() == recording.get_num_segments()
), "The sorting and recording objects must have the same number of samples!"

and complains for out multi-segment recordings with single-segment sorting.

I think we should treat the recording as a single recording.

The error message should mean "segments" instead of "samples".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions