Skip to content

Commit

Permalink
same for multi-channel
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Sep 6, 2024
1 parent ea13bcb commit 4e000ed
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/spikeinterface/postprocessing/template_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,16 @@ def _compute_metrics(self, sorting_analyzer, unit_ids=None, verbose=False, **job
sampling_frequency_up = sampling_frequency

func = _metric_name_to_func[metric_name]
value = func(
template_upsampled,
channel_locations=channel_locations_sparse,
sampling_frequency=sampling_frequency_up,
**self.params["metrics_kwargs"],
)
try:
value = func(
template_upsampled,
channel_locations=channel_locations_sparse,
sampling_frequency=sampling_frequency_up,
**self.params["metrics_kwargs"],
)
except Exception as e:
warnings.warn(f"Error computing metric {metric_name} for unit {unit_id}: {e}")
value = np.nan
template_metrics.at[index, metric_name] = value
return template_metrics

Expand Down

0 comments on commit 4e000ed

Please sign in to comment.