From ab1d01bd60a305ed4f4babb886400eb893ffccdf Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Tue, 31 Oct 2023 08:34:15 -0400 Subject: [PATCH 1/3] remove deprecated code --- .../postprocessing/template_tools.py | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/spikeinterface/postprocessing/template_tools.py diff --git a/src/spikeinterface/postprocessing/template_tools.py b/src/spikeinterface/postprocessing/template_tools.py deleted file mode 100644 index 0d992a0046..0000000000 --- a/src/spikeinterface/postprocessing/template_tools.py +++ /dev/null @@ -1,39 +0,0 @@ -# This is kept in 0.97.0 and then will be removed - -import warnings - -import spikeinterface.core.template_tools as tt - - -def _warn(): - warnings.warn( - "The spikeinterface.postprocessing.template_tools is submodule is deprecated." - "Use spikeinterface.core.template_tools instead", - DeprecationWarning, - stacklevel=2, - ) - - -def get_template_amplitudes(*args, **kwargs): - _warn() - return tt.get_template_amplitudes(*args, **kwargs) - - -def get_template_extremum_channel(*args, **kwargs): - _warn() - return tt.get_template_extremum_channel(*args, **kwargs) - - -def get_template_channel_sparsity(*args, **kwargs): - _warn() - return tt.get_template_channel_sparsity(*args, **kwargs) - - -def get_template_extremum_channel_peak_shift(*args, **kwargs): - _warn() - return tt.get_template_extremum_channel_peak_shift(*args, **kwargs) - - -def get_template_extremum_amplitude(*args, **kwargs): - _warn() - return tt.get_template_extremum_amplitude(*args, **kwargs) From 25d0745a04c0c00e6ef381f18e756944b59a2feb Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Tue, 31 Oct 2023 08:39:54 -0400 Subject: [PATCH 2/3] update init for deprecation --- src/spikeinterface/postprocessing/__init__.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/spikeinterface/postprocessing/__init__.py b/src/spikeinterface/postprocessing/__init__.py index 33e0ff6c03..3aebd13797 100644 --- a/src/spikeinterface/postprocessing/__init__.py +++ b/src/spikeinterface/postprocessing/__init__.py @@ -1,12 +1,3 @@ -# This is kept in 0.97.0 and then will be removed -from .template_tools import ( - get_template_amplitudes, - get_template_extremum_channel, - get_template_extremum_channel_peak_shift, - get_template_extremum_amplitude, - get_template_channel_sparsity, -) - from .template_metrics import ( TemplateMetricsCalculator, compute_template_metrics, From 6ac091ce7a39704af0856fbc80744589a45856ea Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Tue, 31 Oct 2023 08:57:29 -0400 Subject: [PATCH 3/3] fix template function in naive matching --- src/spikeinterface/sortingcomponents/matching/naive.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/spikeinterface/sortingcomponents/matching/naive.py b/src/spikeinterface/sortingcomponents/matching/naive.py index 4b04462e45..9482d50f9a 100644 --- a/src/spikeinterface/sortingcomponents/matching/naive.py +++ b/src/spikeinterface/sortingcomponents/matching/naive.py @@ -1,10 +1,8 @@ """Sorting components: template matching.""" import numpy as np -from spikeinterface.core import WaveformExtractor +from spikeinterface.core import WaveformExtractor, get_template_channel_sparsity, get_template_extremum_channel from spikeinterface.core import get_noise_levels, get_channel_distances, get_chunk_with_margin, get_random_data_chunks -from spikeinterface.postprocessing import get_template_channel_sparsity, get_template_extremum_channel - from spikeinterface.sortingcomponents.peak_detection import DetectPeakLocallyExclusive spike_dtype = [