From 4f3f6490ca56a2d3c0afd095ad0fc7aeb1bf8c35 Mon Sep 17 00:00:00 2001 From: Nicholas Watters Date: Thu, 15 Oct 2026 11:18:59 -0400 Subject: [PATCH] Update MEDiCINe amplitude_threshold_quantile docs and require medicine-neuro>=1.7 medicine-neuro 1.7 applies amplitude_threshold_quantile to absolute amplitude and only accepts values in [0, 1). Update the docstring and pin medicine-neuro>=1.7 so the documented behavior matches what is installed. Co-Authored-By: Claude Opus 5.5 (1M context) --- pyproject.toml | 4 ++-- src/spikeinterface/sortingcomponents/motion/medicine.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3f4b52f666..1ad18dcf83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,7 +139,7 @@ sortingcomponents = [ # pip install torch # `medicine-neuro` is likewise optional (and itself depends on torch), needed only # for the "medicine" motion estimation method. Install separately if needed: - # pip install medicine-neuro + # pip install "medicine-neuro>=1.7" ] sorters_internal = [ @@ -314,7 +314,7 @@ test-exporters = [{include-group = "test-common"}] test-sortingcomponents = [ {include-group = "test-common"}, "torch", # neural network peak detection, motion, matching - "medicine-neuro", # "medicine" motion estimation method + "medicine-neuro>=1.7", # "medicine" motion estimation method "huggingface_hub", # for `test_single_channel_toy_denoiser_in_peak_pipeline` ] test-generation = [ diff --git a/src/spikeinterface/sortingcomponents/motion/medicine.py b/src/spikeinterface/sortingcomponents/motion/medicine.py index 0d1edeb1c9..8be18f7502 100644 --- a/src/spikeinterface/sortingcomponents/motion/medicine.py +++ b/src/spikeinterface/sortingcomponents/motion/medicine.py @@ -30,7 +30,9 @@ class MedicineRegistration: activity_network_hidden_features : tuple, default: (256, 256) Hidden layer sizes for MEDiCINe's activity network. amplitude_threshold_quantile : float, default: 0.0 - Cutoff quantile in [-1, 1] for peak amplitudes. See MEDiCINe's documentation for details. + Fraction in [0, 1) of peaks with the smallest absolute amplitude to ignore. If 0, all peaks are used. + Requires medicine-neuro >= 1.7 (earlier versions thresholded signed amplitudes and accepted values in + [-1, 1]). See MEDiCINe's documentation for details. batch_size : int, default: 4096 Batch size used for training. training_steps : int, default: 10000