Skip to content

Commit

Permalink
Make compute_correlograms compatible with MockWaveformExtractor
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishalcrow committed Mar 6, 2024
1 parent 3b9251f commit 60a1e08
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/spikeinterface/postprocessing/correlograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import numpy as np
from spikeinterface.core.sortinganalyzer import register_result_extension, AnalyzerExtension, SortingAnalyzer

from spikeinterface.core.waveforms_extractor_backwards_compatibility import MockWaveformExtractor

try:
import numba

Expand Down Expand Up @@ -87,6 +89,10 @@ def compute_correlograms(
bin_ms: float = 1.0,
method: str = "auto",
):

if isinstance(sorting_analyzer_or_sorting, MockWaveformExtractor):
sorting_analyzer_or_sorting = sorting_analyzer_or_sorting.sorting

if isinstance(sorting_analyzer_or_sorting, SortingAnalyzer):
return compute_correlograms_sorting_analyzer(
sorting_analyzer_or_sorting, window_ms=window_ms, bin_ms=bin_ms, method=method
Expand Down

0 comments on commit 60a1e08

Please sign in to comment.