From 2a1ecceeaa7a8d38462546feee1434b88d99836a Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Mon, 16 Sep 2024 13:23:00 +0200 Subject: [PATCH] Fix plot_sorting_summary after #3412 with to_numpy() 3 --- src/spikeinterface/widgets/metrics.py | 3 +++ src/spikeinterface/widgets/tests/test_widgets.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/widgets/metrics.py b/src/spikeinterface/widgets/metrics.py index 2fbd0e31eb..813e7d7b63 100644 --- a/src/spikeinterface/widgets/metrics.py +++ b/src/spikeinterface/widgets/metrics.py @@ -235,6 +235,9 @@ def plot_sortingview(self, data_plot, **backend_kwargs): values = check_json(metrics.loc[unit_id].to_dict()) values_skip_nans = {} for k, v in values.items(): + # convert_dypes returns NaN as None or np.nan (for float) + if v is None: + continue if np.isnan(v): continue values_skip_nans[k] = v diff --git a/src/spikeinterface/widgets/tests/test_widgets.py b/src/spikeinterface/widgets/tests/test_widgets.py index debcd52085..80f58f5ad9 100644 --- a/src/spikeinterface/widgets/tests/test_widgets.py +++ b/src/spikeinterface/widgets/tests/test_widgets.py @@ -73,7 +73,7 @@ def setUpClass(cls): spike_amplitudes=dict(), unit_locations=dict(), spike_locations=dict(), - quality_metrics=dict(metric_names=["snr", "isi_violation", "num_spikes"]), + quality_metrics=dict(metric_names=["snr", "isi_violation", "num_spikes", "amplitude_cutoff"]), template_metrics=dict(), correlograms=dict(), template_similarity=dict(),