From a4d8ed9df2f594b5fd0dd5d11b235790a277ece2 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 18 Nov 2026 11:56:13 +0100 Subject: [PATCH 1/2] fix: dartsort wrapper --- src/spikeinterface/sorters/external/dartsort.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/sorters/external/dartsort.py b/src/spikeinterface/sorters/external/dartsort.py index 8e66f7929b..28e383e049 100644 --- a/src/spikeinterface/sorters/external/dartsort.py +++ b/src/spikeinterface/sorters/external/dartsort.py @@ -41,6 +41,9 @@ def _dynamic_params(cls): for k, props in schema["$defs"]["DARTsortUserConfig"]["properties"].items(): default_params_descriptions[k] = props["title"] + default_params.update({"si_motion": None}) + default_params_descriptions.update({"si_motion": "SpikeInterface motion object (optional)"}) + return default_params, default_params_descriptions @classmethod @@ -67,7 +70,7 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose): recording = cls.load_recording_from_folder(sorter_output_folder.parent, with_warnings=False) # Dartsort can be given the motion object optionaly - motion = params.pop("motion", None) + si_motion = params.pop("si_motion", None) # dartsort config are set using dataclass we need to map this cfg = DARTsortUserConfig(**params) @@ -76,7 +79,7 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose): recording, sorter_output_folder, cfg, - motion=motion, + si_motion=si_motion, ) # the DARTsortSorting is not the spikeinterface sorting dartsort_sorting = ret["sorting"] From 57d6da592994b7d71f314a72e1259eb256ac61ed Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 18 Nov 2026 11:59:44 +0100 Subject: [PATCH 2/2] fix: pass si_motion to dartsort --- src/spikeinterface/sorters/external/dartsort.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/sorters/external/dartsort.py b/src/spikeinterface/sorters/external/dartsort.py index 28e383e049..3667e80d5f 100644 --- a/src/spikeinterface/sorters/external/dartsort.py +++ b/src/spikeinterface/sorters/external/dartsort.py @@ -4,7 +4,7 @@ import numpy as np from ..basesorter import BaseSorter -from ...core import load +from ...core import load, Motion class DartsortSorter(BaseSorter): @@ -71,6 +71,8 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose): # Dartsort can be given the motion object optionaly si_motion = params.pop("si_motion", None) + if si_motion is not None: + si_motion = Motion.from_dict(si_motion) # dartsort config are set using dataclass we need to map this cfg = DARTsortUserConfig(**params)