From 850c6dc4bd50818d5b45b857badcce2a695ccb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20WYNGAARD?= Date: Fri, 17 Nov 2023 15:31:24 +0100 Subject: [PATCH] Fixed a bug when caching recording noise levels Caching needs to depend on the method, otherwise the result might be erroneous. --- src/spikeinterface/core/recording_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/core/recording_tools.py b/src/spikeinterface/core/recording_tools.py index 34313cd7ae..030cce7faa 100644 --- a/src/spikeinterface/core/recording_tools.py +++ b/src/spikeinterface/core/recording_tools.py @@ -164,9 +164,9 @@ def get_noise_levels( """ if return_scaled: - key = "noise_level_scaled" + key = f"noise_level_{method}_scaled" else: - key = "noise_level_raw" + key = f"noise_level_{method}_raw" if key in recording.get_property_keys() and not force_recompute: noise_levels = recording.get_property(key=key)