Dataset class#

class pyneon.Dataset(dataset_dir: str | Path)#

Container for multiple recordings. Reads from a directory containing multiple recordings.

For example, a dataset with 2 recordings downloaded from Pupil Cloud 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

Or a dataset with multiple native recordings:

dataset_dir/
├── recording_dir_1/
│   ├── info.json
│   ├── blinks ps1.raw
|   ├── blinks ps1.time
|   ├── blinks.dtype
|   └── ...
└── recording_dir_2/
    ├── info.json
    ├── blinks ps1.raw
    ├── blinks ps1.time
    ├── blinks.dtype
    └── ...

Individual recordings will be read into Recording instances (based on sections.csv, if available) and accessible through the recordings attribute.

Parameters:
dataset_dirstr or pathlib.Path

Path to the directory containing the dataset.

Attributes:
dataset_dirpathlib.Path

Path to the directory containing the dataset.

recordingslist of Recording

List of Recording instances for each recording in the dataset.

sectionspandas.DataFrame

DataFrame containing the sections of the dataset.

Examples

>>> from pyneon import Dataset
>>> dataset = Dataset("path/to/dataset")
>>> print(dataset)

Dataset | 2 recordings

>>> rec = dataset.recordings[0]
>>> print(rec)

Data format: cloud Recording ID: 56fcec49-d660-4d67-b5ed-ba8a083a448a Wearer ID: 028e4c69-f333-4751-af8c-84a09af079f5 Wearer name: Pilot Recording start time: 2025-12-18 17:13:49.460000 Recording duration: 8235000000 ns (8.235 s)