From 4180b22eedef178ca95057ee0140d279c292e9bb Mon Sep 17 00:00:00 2001 From: Samuel Garcia Date: Mon, 16 Oct 2023 13:06:10 +0200 Subject: [PATCH 1/2] Fix slicing in merge.py and so tridesclous2 and so test_launcher.py --- src/spikeinterface/sorters/tests/test_launcher.py | 6 +++--- src/spikeinterface/sortingcomponents/clustering/merge.py | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/spikeinterface/sorters/tests/test_launcher.py b/src/spikeinterface/sorters/tests/test_launcher.py index a5e29c8fd9..fdadf533f5 100644 --- a/src/spikeinterface/sorters/tests/test_launcher.py +++ b/src/spikeinterface/sorters/tests/test_launcher.py @@ -233,15 +233,15 @@ def test_run_sorters_with_dict(): if __name__ == "__main__": - # setup_module() + setup_module() job_list = get_job_list() - # test_run_sorter_jobs_loop(job_list) + test_run_sorter_jobs_loop(job_list) # test_run_sorter_jobs_joblib(job_list) # test_run_sorter_jobs_processpoolexecutor(job_list) # test_run_sorter_jobs_multiprocessing(job_list) # test_run_sorter_jobs_dask(job_list) - test_run_sorter_jobs_slurm(job_list) + # test_run_sorter_jobs_slurm(job_list) # test_run_sorter_by_property() diff --git a/src/spikeinterface/sortingcomponents/clustering/merge.py b/src/spikeinterface/sortingcomponents/clustering/merge.py index c46f214192..a1da1ad6e9 100644 --- a/src/spikeinterface/sortingcomponents/clustering/merge.py +++ b/src/spikeinterface/sortingcomponents/clustering/merge.py @@ -649,11 +649,13 @@ def merge( target_chans = np.intersect1d(target_chans0, target_chans1) union_chans = np.union1d(target_chans0, target_chans1) + + ind0 = list(labels_set).index(label0) - template0 = templates[ind0, :, target_chans] + template0 = templates[ind0][:, target_chans] ind1 = list(labels_set).index(label1) - template1 = templates[ind1, :, target_chans] + template1 = templates[ind1][:, target_chans] num_samples = template0.shape[0] # norm = np.mean(np.abs(template0)) + np.mean(np.abs(template1)) From a00ce05a124962d3fa410947c378082d6c1caa6c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:08:30 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/sortingcomponents/clustering/merge.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/spikeinterface/sortingcomponents/clustering/merge.py b/src/spikeinterface/sortingcomponents/clustering/merge.py index a1da1ad6e9..d35b562298 100644 --- a/src/spikeinterface/sortingcomponents/clustering/merge.py +++ b/src/spikeinterface/sortingcomponents/clustering/merge.py @@ -649,8 +649,6 @@ def merge( target_chans = np.intersect1d(target_chans0, target_chans1) union_chans = np.union1d(target_chans0, target_chans1) - - ind0 = list(labels_set).index(label0) template0 = templates[ind0][:, target_chans]