From 9cc1673f5c1c520636ee7654a067de2b0a68ef96 Mon Sep 17 00:00:00 2001 From: Pierre Yger Date: Fri, 22 Nov 2024 10:14:49 +0100 Subject: [PATCH] Cleaning imports. Need to test with mac --- .../sortingcomponents/clustering/circus.py | 1 - .../sortingcomponents/clustering/random_projections.py | 4 ++-- .../sortingcomponents/clustering/sliding_hdbscan.py | 2 +- src/spikeinterface/sortingcomponents/clustering/tdc.py | 9 ++------- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/spikeinterface/sortingcomponents/clustering/circus.py b/src/spikeinterface/sortingcomponents/clustering/circus.py index 6a341047f4..c1ec3f1aab 100644 --- a/src/spikeinterface/sortingcomponents/clustering/circus.py +++ b/src/spikeinterface/sortingcomponents/clustering/circus.py @@ -18,7 +18,6 @@ from spikeinterface.core.waveform_tools import estimate_templates from .clustering_tools import remove_duplicates_via_matching from spikeinterface.core.recording_tools import get_noise_levels, get_channel_distances -from spikeinterface.core.job_tools import fix_job_kwargs from spikeinterface.sortingcomponents.peak_selection import select_peaks from spikeinterface.sortingcomponents.waveforms.temporal_pca import TemporalPCAProjection from spikeinterface.core.template import Templates diff --git a/src/spikeinterface/sortingcomponents/clustering/random_projections.py b/src/spikeinterface/sortingcomponents/clustering/random_projections.py index 40bb4ac987..484a7376c1 100644 --- a/src/spikeinterface/sortingcomponents/clustering/random_projections.py +++ b/src/spikeinterface/sortingcomponents/clustering/random_projections.py @@ -16,7 +16,7 @@ from spikeinterface.core.basesorting import minimum_spike_dtype from spikeinterface.core.waveform_tools import estimate_templates from .clustering_tools import remove_duplicates_via_matching -from spikeinterface.core.recording_tools import get_noise_levels, get_channel_distances +from spikeinterface.core.recording_tools import get_noise_levels from spikeinterface.sortingcomponents.waveforms.savgol_denoiser import SavGolDenoiser from spikeinterface.sortingcomponents.features_from_peaks import RandomProjectionsFeature from spikeinterface.core.template import Templates @@ -144,7 +144,7 @@ def main_function(cls, recording, peaks, params, job_kwargs=dict()): is_scaled=False, ) if params["noise_levels"] is None: - params["noise_levels"] = get_noise_levels(recording, return_scaled=False) + params["noise_levels"] = get_noise_levels(recording, return_scaled=False, **job_kwargs) sparsity = compute_sparsity(templates, params["noise_levels"], **params["sparsity"]) templates = templates.to_sparse(sparsity) templates = remove_empty_templates(templates) diff --git a/src/spikeinterface/sortingcomponents/clustering/sliding_hdbscan.py b/src/spikeinterface/sortingcomponents/clustering/sliding_hdbscan.py index 2ae810ae20..5f8ac99848 100644 --- a/src/spikeinterface/sortingcomponents/clustering/sliding_hdbscan.py +++ b/src/spikeinterface/sortingcomponents/clustering/sliding_hdbscan.py @@ -23,7 +23,7 @@ get_random_data_chunks, extract_waveforms_to_buffers, ) -from .clustering_tools import auto_clean_clustering, auto_split_clustering +from .clustering_tools import auto_clean_clustering class SlidingHdbscanClustering: diff --git a/src/spikeinterface/sortingcomponents/clustering/tdc.py b/src/spikeinterface/sortingcomponents/clustering/tdc.py index c6b94eaa48..6c361b0562 100644 --- a/src/spikeinterface/sortingcomponents/clustering/tdc.py +++ b/src/spikeinterface/sortingcomponents/clustering/tdc.py @@ -9,27 +9,22 @@ from spikeinterface.core import ( get_channel_distances, - Templates, - compute_sparsity, get_global_tmp_folder, ) from spikeinterface.core.node_pipeline import ( run_node_pipeline, - ExtractDenseWaveforms, ExtractSparseWaveforms, PeakRetriever, ) -from spikeinterface.sortingcomponents.tools import extract_waveform_at_max_channel, cache_preprocessing -from spikeinterface.sortingcomponents.peak_detection import detect_peaks, DetectPeakLocallyExclusive +from spikeinterface.sortingcomponents.tools import extract_waveform_at_max_channel from spikeinterface.sortingcomponents.peak_selection import select_peaks -from spikeinterface.sortingcomponents.peak_localization import LocalizeCenterOfMass, LocalizeGridConvolution from spikeinterface.sortingcomponents.waveforms.temporal_pca import TemporalPCAProjection from spikeinterface.sortingcomponents.clustering.split import split_clusters from spikeinterface.sortingcomponents.clustering.merge import merge_clusters -from spikeinterface.sortingcomponents.clustering.tools import compute_template_from_sparse + class TdcClustering: