From 056c5d248f984aaf0ff3ccca9b30e61866c16a6d Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Tue, 3 Sep 2024 19:53:08 -0600 Subject: [PATCH 1/2] improve docstring api --- src/spikeinterface/comparison/paircomparisons.py | 4 +++- src/spikeinterface/sorters/runsorter.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/comparison/paircomparisons.py b/src/spikeinterface/comparison/paircomparisons.py index fa5ec2d3d0..67a655a67c 100644 --- a/src/spikeinterface/comparison/paircomparisons.py +++ b/src/spikeinterface/comparison/paircomparisons.py @@ -224,7 +224,9 @@ class GroundTruthComparison(BasePairSorterComparison): tested_name : : str, default: None The name of sorter 2 delta_time : float, default: 0.4 - Number of ms to consider coincident spikes + Number of ms to consider coincident spikes. + This means that two spikes are considered simultaneous if they are within delta_time of each other or + mathematically abs(spike1_time - spike2_time) <= delta_time. match_score : float, default: 0.5 Minimum agreement score to match units chance_score : float, default: 0.1 diff --git a/src/spikeinterface/sorters/runsorter.py b/src/spikeinterface/sorters/runsorter.py index 80608f8973..a9fb64d87b 100644 --- a/src/spikeinterface/sorters/runsorter.py +++ b/src/spikeinterface/sorters/runsorter.py @@ -272,7 +272,9 @@ def run_sorter_local( # only classmethod call not instance (stateless at instance level but state is in folder) folder = SorterClass.initialize_folder(recording, folder, verbose, remove_existing_folder) SorterClass.set_params_to_folder(recording, folder, sorter_params, verbose) + # This writes parameters and recording to binary and can happen in the host SorterClass.setup_recording(recording, folder, verbose=verbose) + # This NEEDS to happen in the docker because of dependencies SorterClass.run_from_folder(folder, raise_error, verbose) if with_output: sorting = SorterClass.get_result_from_folder(folder, register_recording=True, sorting_info=True) From 149c5d4daba621909af454d433bdde09d83bec56 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 4 Sep 2024 14:49:23 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com> --- src/spikeinterface/comparison/paircomparisons.py | 2 +- src/spikeinterface/sorters/runsorter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/comparison/paircomparisons.py b/src/spikeinterface/comparison/paircomparisons.py index 67a655a67c..ec1ad7753d 100644 --- a/src/spikeinterface/comparison/paircomparisons.py +++ b/src/spikeinterface/comparison/paircomparisons.py @@ -225,7 +225,7 @@ class GroundTruthComparison(BasePairSorterComparison): The name of sorter 2 delta_time : float, default: 0.4 Number of ms to consider coincident spikes. - This means that two spikes are considered simultaneous if they are within delta_time of each other or + This means that two spikes are considered simultaneous if they are within `delta_time` of each other or mathematically abs(spike1_time - spike2_time) <= delta_time. match_score : float, default: 0.5 Minimum agreement score to match units diff --git a/src/spikeinterface/sorters/runsorter.py b/src/spikeinterface/sorters/runsorter.py index a9fb64d87b..6a24c8814b 100644 --- a/src/spikeinterface/sorters/runsorter.py +++ b/src/spikeinterface/sorters/runsorter.py @@ -272,7 +272,7 @@ def run_sorter_local( # only classmethod call not instance (stateless at instance level but state is in folder) folder = SorterClass.initialize_folder(recording, folder, verbose, remove_existing_folder) SorterClass.set_params_to_folder(recording, folder, sorter_params, verbose) - # This writes parameters and recording to binary and can happen in the host + # This writes parameters and recording to binary and could ideally happen in the host SorterClass.setup_recording(recording, folder, verbose=verbose) # This NEEDS to happen in the docker because of dependencies SorterClass.run_from_folder(folder, raise_error, verbose)