@@ -376,28 +376,16 @@ def get_segment_tuple(info):
376376 for info in info_list :
377377 info ["seg_index" ] = segment_tuple_to_segment_index [get_segment_tuple (info )]
378378
379- # Probe index calculation
380- # The calculation is ordered by slot, port, dock in that order, this is the number that appears in the filename
381- # after imec when using native names (e.g. imec0, imec1, etc.)
382- def get_probe_tuple (info ):
383- slot = normalize (info .get ("probe_slot" ))
384- port = normalize (info .get ("probe_port" ))
385- dock = normalize (info .get ("probe_dock" ))
386- return (slot , port , dock )
387-
388- # TODO: handle one box case
389- info_list_imec = [info for info in info_list if info .get ("device" ) != "nidq" ]
390- unique_probe_tuples = {get_probe_tuple (info ) for info in info_list_imec }
391- sorted_probe_keys = sorted (unique_probe_tuples )
392- probe_tuple_to_probe_index = {key : idx for idx , key in enumerate (sorted_probe_keys )}
393379
394380 for info in info_list :
395- if info .get ("device" ) == "nidq" :
396- info ["device_index" ] = "" # TODO: Handle multi nidq case, maybe use meta["typeNiEnabled"]
381+ # device_kind is imec, nidq
382+ if info .get ("device_kind" ) == "imec" :
383+ info ["device_index" ] = info ["device" ].split ("imec" )[- 1 ]
397384 else :
398- info ["device_index" ] = probe_tuple_to_probe_index [ get_probe_tuple ( info ) ]
385+ info ["device_index" ] = "" # TODO: Handle multi nidq case, maybe use meta["typeNiEnabled" ]
399386
400- # Define stream base on device [imec|nidq], device_index and stream_kind [ap|lf] for imec
387+ # Define stream base on device_kind [imec|nidq], device_index and stream_kind [ap|lf] for imec
388+ # Stream format is "{device_kind}{device_index}.{stream_kind}"
401389 for info in info_list :
402390 device_kind = info ["device_kind" ]
403391 device_index = info ["device_index" ]
@@ -524,6 +512,7 @@ def extract_stream_info(meta_file, meta):
524512 # NIDQ case
525513 has_sync_trace = False
526514
515+ # This is the original name that the file had. It might not match the current name if the user changed it
527516 bin_file_path = meta ["fileName" ]
528517 fname = Path (bin_file_path ).stem
529518
0 commit comments