Issue with read_raw_eyelink()

Hi,

I am using read_raw_eyelink() to import an .asc file:

raw = read_raw_eyelink(fname)

But I get the following error when running this line:

--> 125     if tokens[0][0].isnumeric():  # Samples
ref='~/anaconda3/envs/mne/lib/python3.12/site-packages/mne/io/eyelink/_utils.py:1'>1</a>;32m    
    126         data_dict["sample_lines"].append(tokens)
    127     elif tokens[0] in data_dict["event_lines"].keys():

IndexError: list index out of range

Here’s my system info:

  • MNE version: 1.6.0.dev175+gf02e5576d
  • operating system: macOS-12.6
  • Python: 3.12.0

The eye-tracking file itself is fine as it could be imported using RStudio.

Here is the link to a test file:

Appreciate any advice and help!

Thanks,
Lizzie

@scott-huberty I lack the time to look at it now, feel free to beat me to it, else I’ll have a look in the coming days.

Sure, I’ll take a look at it today or tomorrow

Indeed a bug. I opened a PR to fix the issue: FIX: skip empty lines in read_raw_eyelink by scott-huberty · Pull Request #12172 · mne-tools/mne-python · GitHub

@Lizzie are you comfortable with using git to install the development version of MNE-Python (assuming you aren’t already using the development version)?

3 Likes

I already installed the 1.6.0 development version. Will it work if I upgrade it again after the bug is fixed?

2 Likes

Awesome. Yes, once a fix is merged, you can update your local fork and you should be good to go.

Thanks for the report and for quickly sharing an example file!

Update: The aforementioned PR that fixes the issue has been merged

2 Likes