Skip to content

Commit c725820

Browse files
Wouter KrootWouter Kroot
authored andcommitted
commit before rebase
1 parent c45c754 commit c725820

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

mne/io/eyelink/_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,13 @@ def _assign_col_names(col_names, df_dict):
579579
Dictionary of dataframes to assign column names to.
580580
"""
581581
skipped_types = []
582+
breakpoint()
582583
for key, df in df_dict.items():
584+
print(df.head()) # debug
585+
print(df.shape)
586+
print(df)
583587
if key in ("samples", "blinks", "fixations", "saccades"):
588+
print(f"Key: {key}, df columns: {df.shape[1]}, expected: {len(col_names[key])}") #debug
584589
df.columns = col_names[key]
585590
elif key == "messages":
586591
cols = ["time", "offset", "event_msg"]
@@ -876,7 +881,9 @@ def _make_eyelink_annots(df_dict, create_annots, apply_offsets):
876881
descriptions = key[:-1] # i.e "blink", "fixation", "saccade"
877882
if key == "blinks":
878883
descriptions = "BAD_" + descriptions
884+
879885
ch_names = df["eye"].map(eye_ch_map).tolist()
886+
breakpoint() # debug
880887
this_annot = Annotations(
881888
onset=onsets,
882889
duration=durations,
@@ -921,6 +928,7 @@ def get_button_description(row):
921928
if not annots:
922929
warn(f"Annotations for {descs} were requested but none could be made.")
923930
return
931+
924932
return annots
925933

926934

mne/io/eyelink/tests/test_eyelink.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,22 +507,27 @@ def test_href_eye_events(tmp_path):
507507
"""Test Parsing file where Eye Event Data option was set to 'HREF'."""
508508
out_file = tmp_path / "tmp_eyelink.asc"
509509
lines = fname_href.read_text("utf-8").splitlines()
510+
breakpoint()
510511
for li, line in enumerate(lines):
511512
if not line.startswith(("ESACC", "EFIX")):
512513
continue
513514
tokens = line.split()
514515
if line.startswith("ESACC"):
515516
href_sacc_vals = ["9999", "9999", "9999", "9999", "99.99", "999"]
516517
tokens[5:5] = href_sacc_vals # add href saccade values
517-
518+
print(f"\nLine {li}: {line}")
519+
print(f"Tokens ({len(tokens)}): {tokens}")
520+
518521
elif line.startswith("EFIX"):
519522
tokens = line.split()
520523
href_fix_vals = ["9999.9", "9999.9", "999"]
521524
tokens[5:3] = href_fix_vals
522525
new_line = "\t".join(tokens) + "\n"
523526
lines[li] = new_line
524527
out_file.write_text("\n".join(lines), encoding="utf-8")
528+
breakpoint()
525529
raw = read_raw_eyelink(out_file)
526-
# Just check that we actually parsed the Saccade and Fixation events
527-
assert "saccade" in raw.annotations.description
528-
assert "fixation" in raw.annotations.description
530+
#breakpoint()
531+
# # Just check that we actually parsed the Saccade and Fixation events
532+
# assert "saccade" in raw.annotations.description
533+
# assert "fixation" in raw.annotations.description

0 commit comments

Comments
 (0)