nalmadi / EMIP-Toolkit

EMIP Toolkit (EMTK): A Python Library for Processing Eye Movement in Programming Data
16 stars 22 forks source link

Parse samples into dataframe / a list of objects instead of list #72

Closed quanphan2906 closed 2 years ago

quanphan2906 commented 2 years ago

The samples field of the Trial class stores the raw samples from datasets. The field is currently a list of samples, with each sample represented by another list. The field should be, however, a dataframe, with each row corresponding with one sample, or a list of objects, with each object corresponding with one sample. This way, it will be clearer what features each sample has.

Represent each sample with a list can lead to the use of magic numbers to access sample's information. An example can be seen below: https://github.com/nalmadi/EMIP-Toolkit/blob/d1a7eabd08ca27c062b5f14118395eaea8d5eac2/emip_toolkit.py#L431-L436

quanphan2906 commented 2 years ago

With the new design (functional programming), samples is now an independent dataframe that stores every raw sample from a dataset. Each column of samples is also clearly labeled.