File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
element_array_ephys/spike_sorting Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -275,11 +275,17 @@ def make(self, key):
275
275
276
276
analyzer_output_dir = output_dir / sorter_name / "sorting_analyzer"
277
277
278
+ has_units = si_sorting .unit_ids .size > 0
279
+
278
280
@memoized_result (
279
281
uniqueness_dict = postprocessing_params ,
280
282
output_directory = analyzer_output_dir ,
281
283
)
282
284
def _sorting_analyzer_compute ():
285
+ if not has_units :
286
+ log .info ("No units found in sorting object. Skipping sorting analyzer." )
287
+ return
288
+
283
289
# Sorting Analyzer
284
290
sorting_analyzer = si .create_sorting_analyzer (
285
291
sorting = si_sorting ,
@@ -303,6 +309,8 @@ def _sorting_analyzer_compute():
303
309
304
310
_sorting_analyzer_compute ()
305
311
312
+ do_si_export = postprocessing_params .get ("export_to_phy" , False ) or postprocessing_params .get ("export_report" , False )
313
+
306
314
self .insert1 (
307
315
{
308
316
** key ,
@@ -311,8 +319,7 @@ def _sorting_analyzer_compute():
311
319
datetime .utcnow () - execution_time
312
320
).total_seconds ()
313
321
/ 3600 ,
314
- "do_si_export" : postprocessing_params .get ("export_to_phy" , False )
315
- or postprocessing_params .get ("export_report" , False ),
322
+ "do_si_export" : do_si_export and has_units ,
316
323
}
317
324
)
318
325
You can’t perform that action at this time.
0 commit comments