Skip to content

Commit

Permalink
Check for random_spikes extension before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishalcrow committed Mar 6, 2024
1 parent 6998b1f commit b24e5fa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/spikeinterface/core/analyzer_extension_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def _compute_and_append(self, operators):

# spikes = self.sorting_analyzer.sorting.to_spike_vector()
# some_spikes = spikes[self.sorting_analyzer.random_spikes_indices]
assert self.sorting_analyzer.has_extension("random_spikes"), "compute templates requires the random_spikes extension."
some_spikes = self.sorting_analyzer.get_extension("random_spikes").some_spikes()
for unit_index, unit_id in enumerate(unit_ids):
spike_mask = some_spikes["unit_index"] == unit_index
Expand Down

0 comments on commit b24e5fa

Please sign in to comment.