Skip to content

Commit

Permalink
oups
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Sep 19, 2023
1 parent 26cfd5d commit 2bd7dd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/spikeinterface/qualitymetrics/misc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ def compute_synchrony_metrics(waveform_extractor, synchrony_sizes=(2, 4, 8), uni
for synchrony_size in synchrony_sizes:
synchrony_counts[synchrony_size] = np.zeros(len(waveform_extractor.unit_ids), dtype=np.int64)

all_unit_ids = list(sorting.unit_ids)
for segment_index in range(sorting.get_num_segments()):
spikes_in_segment = spikes[segment_index]

Expand All @@ -544,7 +545,7 @@ def compute_synchrony_metrics(waveform_extractor, synchrony_sizes=(2, 4, 8), uni

# add counts for this segment
for unit_id in unit_ids:
unit_index = sorting.unit_ids.index(unit_id)
unit_index = all_unit_ids.index(unit_id)
spikes_per_unit = spikes_in_segment[spikes_in_segment["unit_index"] == unit_index]
# some segments/units might have no spikes
if len(spikes_per_unit) == 0:
Expand Down

0 comments on commit 2bd7dd6

Please sign in to comment.