@@ -315,54 +315,36 @@ def __init__(
315315
316316 # find settings file
317317 if "#" in stream_name :
318- record_node , oe_stream = stream_name .split ("#" )
318+ record_node , oe_stream_name = stream_name .split ("#" )
319319 else :
320320 record_node = ""
321- oe_stream = stream_name
322- exp_ids = sorted (list (self .neo_reader .folder_structure [record_node ]["experiments" ].keys ()))
321+ oe_stream_name = stream_name
322+ node_structure = self .neo_reader .folder_structure [record_node ]
323+ exp_ids = sorted (list (node_structure ["experiments" ].keys ()))
323324 if block_index is None :
324325 exp_id = exp_ids [0 ]
325326 else :
326327 exp_id = exp_ids [block_index ]
327- rec_ids = sorted (
328- list (self .neo_reader .folder_structure [record_node ]["experiments" ][exp_id ]["recordings" ].keys ())
329- )
328+ rec_ids = sorted (list (node_structure ["experiments" ][exp_id ]["recordings" ].keys ()))
330329
331330 # do not load probe for NIDQ stream or if load_sync_channel is True
332331 if "NI-DAQmx" not in stream_name and not load_sync_channel :
333- settings_file = self . neo_reader . folder_structure [ record_node ] ["experiments" ][exp_id ]["settings_file" ]
332+ settings_file = node_structure ["experiments" ][exp_id ]["settings_file" ]
334333
335334 if Path (settings_file ).is_file ():
336335 probe = probeinterface .read_openephys (
337- settings_file = settings_file , stream_name = stream_name , raise_error = False
336+ settings_file = settings_file , stream_name = oe_stream_name , raise_error = False
338337 )
339338 else :
340339 probe = None
341340
342341 if probe is not None :
343- # Ensure device channel index corresponds to channel_ids
344- probe_channel_names = probe .contact_annotations .get ("channel_name" , None )
345- if probe_channel_names is not None and not np .array_equal (probe_channel_names , self .channel_ids ):
346- if set (probe_channel_names ) == set (self .channel_ids ):
347- device_channel_indices = []
348- probe_channel_names = list (probe_channel_names )
349- device_channel_indices = np .zeros (len (self .channel_ids ), dtype = int )
350- for i , ch in enumerate (self .channel_ids ):
351- index_in_probe = probe_channel_names .index (ch )
352- device_channel_indices [index_in_probe ] = i
353- probe .set_device_channel_indices (device_channel_indices )
354- else :
355- warnings .warn (
356- "Channel names in the probe do not match the channel ids from Neo. "
357- "Cannot set device channel indices, but this might lead to incorrect probe geometries"
358- )
359-
360342 if probe .shank_ids is not None :
361343 self .set_probe (probe , in_place = True , group_mode = "by_shank" )
362344 else :
363345 self .set_probe (probe , in_place = True )
364346 # get inter-sample shifts based on the probe information and mux channels
365- sample_shifts = get_neuropixels_sample_shifts_from_probe (probe , stream_name = self . stream_name )
347+ sample_shifts = get_neuropixels_sample_shifts_from_probe (probe )
366348 if sample_shifts is not None :
367349 self .set_property ("inter_sample_shift" , sample_shifts )
368350
@@ -371,7 +353,7 @@ def __init__(
371353 stream_folders = []
372354 for segment_index , rec_id in enumerate (rec_ids ):
373355 stream_folder = (
374- recording_folder / f"experiment{ exp_id } " / f"recording{ rec_id } " / "continuous" / oe_stream
356+ recording_folder / f"experiment{ exp_id } " / f"recording{ rec_id } " / "continuous" / oe_stream_name
375357 )
376358 stream_folders .append (stream_folder )
377359 if load_sync_timestamps :
0 commit comments