@@ -63,7 +63,7 @@ class Tridesclous2Sorter(ComponentsBasedSorter):
6363 },
6464 # "matching": {"method": "tridesclous", "method_kwargs": {"peak_shift_ms": 0.2, "radius_um": 100.0}},
6565 # "matching": {"method": "circus-omp-svd", "method_kwargs": {}},
66- "matching" : {"method" : "wobble" , "method_kwargs" : {}},
66+ "matching" : {"method" : "wobble" , "method_kwargs" : {}, "gather_mode" : "memory" },
6767 "job_kwargs" : {"n_jobs" : - 1 },
6868 "save_array" : True ,
6969 }
@@ -232,13 +232,22 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose):
232232 templates = remove_empty_templates (templates )
233233
234234 ## peeler
235- matching_method = params ["matching" ]["method" ]
236- matching_params = params ["matching" ]["method_kwargs" ].copy ()
235+ matching_method = params ["matching" ].pop ("method" )
236+ gather_mode = params ["matching" ].pop ("gather_mode" , "memory" )
237+ gather_kwargs = params ["matching" ].pop ("gather_kwargs" , {})
238+ matching_params = params ["matching" ].get ("matching_kwargs" , {}).copy ()
237239 matching_params ["templates" ] = templates
238- if params [ "matching" ][ "method" ] in ("tdc-peeler" ,):
240+ if matching_method in ("tdc-peeler" ,):
239241 matching_params ["noise_levels" ] = noise_levels
242+ if gather_mode == "npy" :
243+ gather_kwargs = {"folder" : gather_kwargs .get ("folder" , sorter_output_folder / "matching" )}
240244 spikes = find_spikes_from_templates (
241- recording_for_peeler , method = matching_method , method_kwargs = matching_params , ** job_kwargs
245+ recording_for_peeler ,
246+ method = matching_method ,
247+ method_kwargs = matching_params ,
248+ gather_mode = gather_mode ,
249+ gather_kwargs = gather_kwargs ,
250+ ** job_kwargs ,
242251 )
243252
244253 if params ["save_array" ]:
0 commit comments