File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Fix iteration errors in :func: `mne.io.read_raw_nihon ` when reading log files, by `Tom Ma `_.
Original file line number Diff line number Diff line change @@ -289,21 +289,23 @@ def _read_nihon_header(fname):
289289
290290
291291def _read_event_log_block (fid , t_block , version ):
292+ empty_logs = np .empty (0 , dtype = "|S45" )
293+
292294 fid .seek (0x92 + t_block * 20 )
293295 data = np .fromfile (fid , np .uint32 , 1 )
294296 if data .size == 0 or data [0 ] == 0 :
295- return
297+ return empty_logs
296298 t_blk_address = data [0 ]
297299
298300 fid .seek (t_blk_address + 0x1 )
299301 data = np .fromfile (fid , "|S16" , 1 ).astype ("U16" )
300302 if data .size == 0 or data [0 ] != version :
301- return
303+ warn ( f"Event log version mismatch: expected ' { version } ', got ' { data } '" )
302304
303305 fid .seek (t_blk_address + 0x12 )
304306 data = np .fromfile (fid , np .uint8 , 1 )
305307 if data .size == 0 :
306- return
308+ return empty_logs
307309 n_logs = data [0 ]
308310
309311 fid .seek (t_blk_address + 0x14 )
You can’t perform that action at this time.
0 commit comments