Skip to content

Commit 7671ed4

Browse files
Wouter KrootWouter Kroot
authored andcommitted
shorten some strings for tests
1 parent a6624c0 commit 7671ed4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

mne/io/eyelink/_utils.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -743,21 +743,17 @@ def _make_eyelink_annots(df_dict, create_annots, apply_offsets):
743743
elif (key == "buttons") and (key in descs):
744744
required_cols = {"time", "button_id", "button_pressed"}
745745
if not required_cols.issubset(df.columns):
746-
raise ValueError(
747-
f"Missing required columns for 'buttons': {required_cols - set(df.columns)}"
748-
)
746+
raise ValueError(f"Missing column: {required_cols - set(df.columns)}")
749747

750748
def get_button_description(row):
751749
try:
752750
button_id = int(row["button_id"])
753751
action = "press" if row["button_pressed"] == 1 else "release"
754752
return f"button_{button_id}_{action}"
755753
except Exception as e:
756-
raise ValueError(
757-
f"Invalid row for button description: {row}"
758-
) from e
759-
760-
df = df.sort_values("time") # Add this line
754+
raise ValueError(f"Invalid row for button: {row}") from e
755+
756+
df = df.sort_values("time")
761757
onsets = df["time"]
762758
durations = np.zeros_like(onsets)
763759
descriptions = df.apply(get_button_description, axis=1)

0 commit comments

Comments
 (0)