Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/spikeinterface/sorters/external/dartsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np

from ..basesorter import BaseSorter
from ...core import load
from ...core import load, Motion


class DartsortSorter(BaseSorter):
Expand Down Expand Up @@ -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)"})
Comment thread
alejoe91 marked this conversation as resolved.
Resolved

return default_params, default_params_descriptions

@classmethod
Expand All @@ -67,7 +70,9 @@ 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)
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)
Expand All @@ -76,7 +81,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"]
Expand Down
Loading