Skip to content

Commit

Permalink
job_kwargs propagated everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Nov 22, 2024
1 parent 2885aeb commit 3b39a05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/spikeinterface/sorters/internal/spyking_circus2.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose):
sorting.save(folder=curation_folder)
# np.save(fitting_folder / "amplitudes", guessed_amplitudes)

sorting = final_cleaning_circus(recording_w, sorting, templates, **merging_params)
sorting = final_cleaning_circus(recording_w, sorting, templates, merging_params, **job_kwargs)

if verbose:
print(f"Final merging, keeping {len(sorting.unit_ids)} units")
Expand Down Expand Up @@ -410,16 +410,17 @@ def divide_recording(recording, seed=None, **job_kwargs):
return recording_slices


def final_cleaning_circus(recording, sorting, templates, **merging_kwargs):
def final_cleaning_circus(recording, sorting, templates, merging_kwargs, **job_kwargs):

from spikeinterface.core.sorting_tools import apply_merges_to_sorting

sa = create_sorting_analyzer_with_templates(sorting, recording, templates)
sa.compute("unit_locations", method="monopolar_triangulation")

sa.compute("unit_locations", method="monopolar_triangulation", **job_kwargs)
similarity_kwargs = merging_kwargs.pop("similarity_kwargs", {})
sa.compute("template_similarity", **similarity_kwargs)
sa.compute("template_similarity", **similarity_kwargs, **job_kwargs)
correlograms_kwargs = merging_kwargs.pop("correlograms_kwargs", {})
sa.compute("correlograms", **correlograms_kwargs)
sa.compute("correlograms", **correlograms_kwargs, **job_kwargs)

auto_merge_kwargs = merging_kwargs.pop("auto_merge", {})
merges = get_potential_auto_merge(sa, resolve_graph=True, **auto_merge_kwargs)
sorting = apply_merges_to_sorting(sa.sorting, merges)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def detect_mixtures(templates, method_kwargs={}, job_kwargs={}, tmp_folder=None,
)
else:
recording = NumpyRecording(zdata, sampling_frequency=fs)
recording = SharedMemoryRecording.from_recording(recording)
recording = SharedMemoryRecording.from_recording(recording, **job_kwargs)

recording = recording.set_probe(templates.probe)
recording.annotate(is_filtered=True)
Expand Down

0 comments on commit 3b39a05

Please sign in to comment.