Skip to content

Commit

Permalink
Patch to force remove sorters
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Nov 29, 2024
1 parent 853d8a4 commit 0c88b39
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/spikeinterface/benchmark/benchmark_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ def run(self, case_keys=None, keep=True, verbose=False, **job_kwargs):
for key in case_keys:

result_folder = self.folder / "results" / self.key_to_str(key)

sorter_folder = self.folder / "sorters" / self.key_to_str(key)

if keep and result_folder.exists():
continue
elif not keep and result_folder.exists():
elif not keep and (result_folder.exists() or sorter_folder.exists()):
self.remove_benchmark(key)
job_keys.append(key)

Expand Down
9 changes: 9 additions & 0 deletions src/spikeinterface/benchmark/benchmark_sorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ def create_benchmark(self, key):
benchmark = SorterBenchmark(recording, gt_sorting, params, sorter_folder)
return benchmark

def remove_benchmark(self, key):
BenchmarkStudy.remove_benchmark(self, key)

sorter_folder = self.folder / "sorters" / self.key_to_str(key)
import shutil
if sorter_folder.exists():
shutil.rmtree(sorter_folder)


def get_performance_by_unit(self, case_keys=None):
import pandas as pd

Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/curation/auto_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def compute_merge_unit_groups(
params = _default_step_params.get(step).copy()
if steps_params is not None and step in steps_params:
params.update(steps_params[step])

# STEP : remove units with too few spikes
if step == "num_spikes":

Expand Down

0 comments on commit 0c88b39

Please sign in to comment.