Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: parse eyelink events #945

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Mar 8, 2025
commit 51bebe37ad77ef01f4b3b2cbf2a6f3c2baac5ed3
5 changes: 3 additions & 2 deletions src/pymovements/gaze/_utils/parsing.py
Original file line number Diff line number Diff line change
@@ -205,8 +205,9 @@ def parse_eyelink_event_start(line: str) -> str | None:
def parse_eyelink_event_end(line: str) -> tuple[str, float, float] | None:
"""Check if the line contains the start of an event and return the event name and times."""
if match := FIXATION_STOP_REGEX.match(line):
return 'fixation', float(match.group('timestamp_start')
), float(match.group('timestamp_end'))
return 'fixation', float(
match.group('timestamp_start'),
), float(match.group('timestamp_end'))
if match := SACCADE_STOP_REGEX.match(line):
return 'saccade', float(match.group('timestamp_start')), float(match.group('timestamp_end'))
if match := BLINK_STOP_REGEX.match(line):