aeye-lab / pymovements

A python package for processing eye movement data
https://pymovements.readthedocs.io
MIT License
61 stars 12 forks source link

parse metadata in utils.parsing.parse_eyelink #510

Open dkrako opened 1 year ago

dkrako commented 1 year ago

Description of the problem

The header of an asc file has a lot of metadata which we can parse.

Description of a solution

Instead of just returning a dataframe, the function then should return a tuple of a dataframe and a dictionary with parsed info

Minimum acceptance criteria

Context

the eyelink_parser from eyelinker is a good reference for implementation: https://github.com/cran/eyelinker/blob/master/R/eyelink_parser.R

https://cran.r-project.org/web/packages/eyelinker/vignettes/format.html

dkrako commented 10 months ago

This is the current signature: https://github.com/aeye-lab/pymovements/blob/9eb46c56230cbe5deebbc7af6797745a46af1613/src/pymovements/utils/parsing.py#L110-L114

 def parse_eyelink( 
         filepath: Path | str, 
         patterns: list | None = None, 
         schema: dict | None = None, 
 ) -> tuple[pl.DataFrame, dict[str, Any]] : 

The keys of the dictionary should resemble the metadata.