You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we need the Dataset class to load GazeDataFrames.
Description of a solution
It would be much nicer to have a self-contained solution in a function like pymovements.gaze.from_csv() which returns a GazeDataFrame loaded from a csv file.
Most functionality is already included in dataset/dataset_files.py, so parts can be reused in gaze/io.py.
We won't need to add any fileinfo columns for now.
We will refactor dataset/dataset_files.py after finishing #508 and #518.
For a start, we can use **kwargs to forward all specific reading arguments to polars.read_csv()
Simply passing **kwargs will also shorten testing and documentation. But we should discuss if we want to add all the arguments explictly.
Although having all arguments explicit is probably the best solution, we would then need to keep the documentation up to date. We should therefore discuss if a more self-contained documentation is worth the effort. (probably it is)
Minimum acceptance criteria
pm.gaze.from_csv() in gaze/io.py
tests in tests/gaze/io/csv_test.py
create at least one monocular and a binocular csv test file with 10 rows (can be all zero) in tests/gaze/io/files/
the PR should include simple csv test files which should be then loaded in tests (maybe also write a fixture to simplify usage).
there should actually be a range of csv files, although the files should probably all be limited to about 10 rows
we can also test several header configurations (monocular, binocular, with/without time column, pixel data, dva data, stimulus, etc.)
this will probably help resolving #492 by a lot, because we could also create toy version csv files for gazebase and judo1000
Description of the problem
Currently we need the Dataset class to load GazeDataFrames.
Description of a solution
It would be much nicer to have a self-contained solution in a function like
pymovements.gaze.from_csv()
which returns a GazeDataFrame loaded from a csv file.Most functionality is already included in
dataset/dataset_files.py
, so parts can be reused ingaze/io.py
.We won't need to add any
fileinfo
columns for now.We will refactor
dataset/dataset_files.py
after finishing #508 and #518.For a start, we can use
**kwargs
to forward all specific reading arguments topolars.read_csv()
Simply passing
**kwargs
will also shorten testing and documentation. But we should discuss if we want to add all the arguments explictly.Although having all arguments explicit is probably the best solution, we would then need to keep the documentation up to date. We should therefore discuss if a more self-contained documentation is worth the effort. (probably it is)
Minimum acceptance criteria
pm.gaze.from_csv()
ingaze/io.py
tests/gaze/io/csv_test.py
tests/gaze/io/files/
Code example
proposed function signature:
The text was updated successfully, but these errors were encountered: