Skip to content

Change to event handling #1

@TommasoGhilardi

Description

@TommasoGhilardi

@FrancescPoli
I’d like to propose we adopt a DeToX-style workflow for handling triggers and data collection with Tobii Research. It’ll involve a shift from our current global-based pipeline, but I think it’ll simplify the code and give us more flexible export options.

We could use two in-memory lists

  • Data samples (raw eye-tracking records)
  • Trigger events

Then we can:

  • Convert each list into its own pandas DataFrame
  • Perform a nearest-timestamp merge so triggers align with samples

Why this helps

  • Cleaner code: removes that hard-to-manage global, reducing hidden side effects and making testing easier.
  • Dual export modes:
    • Merged DataFrame—each trigger matched to its closest sample (ideal for most analyses)
    • Separate DataFrames—raw samples and raw triggers preserved for anyone needing millisecond-level accuracy (we can document this under “Advanced Usage”)

This does alter our existing pipeline, but it keeps things modular and lets users choose between convenience (one merged table) and precision (two raw tables). I’d love to hear your thoughts or any concerns before I build out a prototype!

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions