Dataset class#

class pyneon.Dataset(dataset_dir: str | Path, custom: bool = False)#

Holder for multiple recordings. It reads from a directory containing a multiple recordings downloaded from Pupil Cloud with the Timeseries CSV or Timeseries CSV and Scene Video option. For example, a dataset with 2 recordings would have the following folder structure:

dataset_dir/
├── recording_dir_1/
│   ├── info.json
│   ├── gaze.csv
|   └── ...
├── recording_dir_2/
│   ├── info.json
│   ├── gaze.csv
|   └── ...
├── ...
├── enrichment_info.txt
└── sections.csv

Individual recordings will be read into pyneon.Recording objects based on sections.csv. They are accessible through the recordings attribute.

Parameters:
  • dataset_dir (str or pathlib.Path) – Path to the directory containing the dataset.

  • custom (bool, optional) – Whether to expect a custom dataset structure. If False, the dataset is expected to follow the standard Pupil Cloud dataset structure with a sections.csv file. If True, every directory in dataset_dir is considered a recording directory, and the sections attribute is constructed from the info of recordings found. Defaults to False.

dataset_dir#

Path to the directory containing the dataset.

Type:

pathlib.Path

recordings#

List of pyneon.Recording objects for each recording in the dataset.

Type:

list of Recording

sections#

DataFrame containing the sections of the dataset.

Type:

pandas.DataFrame

load_enrichment(enrichment_dir: str | Path)#

Load enrichment information from an enrichment directory. The directory must contain an enrichment_info.txt file. Enrichment data will be parsed for each recording ID and added to Recording object in the dataset.

The method is currently being developed and is not yet implemented.

Parameters:

enrichment_dir (str or pathlib.Path) – Path to the directory containing the enrichment information.