Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow auto_merge to work with fast_templates #2551

Merged
merged 5 commits into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/spikeinterface/curation/auto_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ def get_potential_auto_merge(

# STEP 5 : check if potential merge with CC also have template similarity
if "template_similarity" in steps:
templates = sorting_analyzer.get_extension("templates").get_templates(operator="average")
templates_ext = sorting_analyzer.get_extension("templates") or sorting_analyzer.get_extension("fast_templates")
assert (
templates_ext is not None
), "auto_merge with template_similarity requires a SortingAnalyzer with extension templates or fast_templates"

templates = templates_ext.get_templates(operator="average")
templates_diff = compute_templates_diff(
sorting, templates, num_channels=num_channels, num_shift=num_shift, pair_mask=pair_mask
)
Expand Down
Loading