.. currentmodule:: pypillometry.datasets Open datasets ============= pypillometry comes with a few open datasets: whole studies whose data are on OSF or figshare. The data are not part of pypillometry; they are downloaded when you first need them and kept in a folder (see :ref:`datasets-storage`). Please cite the study (``ds.cite()``) when you use its data. .. code-block:: python import pypillometry as pp pp.datasets.list_datasets() # name, tracker, tasks, subjects, size ds = pp.datasets.get("robison2022") ds # summary of the dataset ds.cite() d = ds.load("1727", "pvt") # downloads the recording if needed .. list-table:: :header-rows: 1 :widths: 20 80 * - name - dataset * - ``robison2022`` - :class:`RobisonBrewer2022`: pupil size of ~260 participants in a baseline, a psychomotor vigilance and a change detection task (GazePoint GP3, 60 Hz), with demographics, behaviour and cognitive ability scores (10 GB) * - ``rlmw`` - :class:`RLMW`: gaze and pupil of 50 participants in a reinforcement learning task with mind-wandering probes (EyeLink, 500 Hz), with the behaviour of each trial and questionnaires (2 GB; not published yet) An open dataset has the same methods as your own study (tables, loading, excluding, preprocessing, segments); see :doc:`studies`. .. _datasets-download: Downloading ----------- :meth:`~Dataset.load` downloads the files of one recording when they are needed. :meth:`~Dataset.download` downloads the whole dataset or some subjects and tasks (several at a time). Each recording is converted to a pypillometry file right after the download and its raw files are deleted; from then on it loads from that file and is not downloaded again (unless ``download(overwrite=True)``). .. code-block:: python ds.download() # everything (see ds.info()["size"]) ds.download(subjects=["1545", "1727"]) # some subjects, all tasks Each file is checked against the checksum in the dataset's manifest (the list of its files with their checksums, which comes with pypillometry), and downloaded again if it does not match. .. _datasets-storage: Where the data are stored ------------------------- By default in ``~/.cache/pypillometry/datasets/`` (or ``$XDG_CACHE_HOME/pypillometry/datasets/``): the recordings as pypillometry files in ``pypil/``, the tables with the paths of the repository. To keep the raw files too, use ``pp.datasets.get(name, keep_raw=True)``. Set the environment variable ``PYPILLOMETRY_DATA_DIR`` to keep all datasets somewhere else (then in ``$PYPILLOMETRY_DATA_DIR/``), or give a folder for one dataset: .. code-block:: python ds = pp.datasets.get("robison2022", path="/data/robison2022")