From e45a9f85d49474d625bb4728b971b8357368e643 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Fri, 10 Jan 2025 11:52:40 +0100 Subject: [PATCH] Exploit hard-coded sync sizes --- .../qualitymetrics/quality_metric_calculator.py | 5 +---- src/spikeinterface/qualitymetrics/quality_metric_list.py | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/spikeinterface/qualitymetrics/quality_metric_calculator.py b/src/spikeinterface/qualitymetrics/quality_metric_calculator.py index 834c8a9974..02409ffdbb 100644 --- a/src/spikeinterface/qualitymetrics/quality_metric_calculator.py +++ b/src/spikeinterface/qualitymetrics/quality_metric_calculator.py @@ -251,10 +251,7 @@ def _compute_metrics(self, sorting_analyzer, unit_ids=None, verbose=False, metri # we have one issue where the name of the columns for synchrony are named based on # what the user has input as arguments so we need a way to handle this separately # everything else should be handled with the column name. - if "sync" in column: - metrics[column] = metrics[column].astype(column_name_to_column_dtype["sync"]) - else: - metrics[column] = metrics[column].astype(column_name_to_column_dtype[column]) + metrics[column] = metrics[column].astype(column_name_to_column_dtype[column]) return metrics diff --git a/src/spikeinterface/qualitymetrics/quality_metric_list.py b/src/spikeinterface/qualitymetrics/quality_metric_list.py index fc7ae906e7..23b781eb9d 100644 --- a/src/spikeinterface/qualitymetrics/quality_metric_list.py +++ b/src/spikeinterface/qualitymetrics/quality_metric_list.py @@ -70,7 +70,7 @@ "sync_spike_2", "sync_spike_4", "sync_spike_8", - ], # we probably shouldn't hard code this. This is determined by the arguments in the function... + ], "firing_range": ["firing_range"], "drift": ["drift_ptp", "drift_std", "drift_mad"], "sd_ratio": ["sd_ratio"], @@ -99,7 +99,9 @@ "amplitude_median": float, "amplitude_cv_median": float, "amplitude_cv_range": float, - "sync": float, + "sync_spike_2": float, + "sync_spike_4": float, + "sync_spike_8": float, "firing_range": float, "drift_ptp": float, "drift_std": float,