Utility functions#
- pyneon.utils.get_sample_data(data_name: str, replace: bool = False, format: Literal['cloud', 'native'] | None = None) Path#
Download and retrieve sample data for PyNeon.
This function downloads sample data from predefined URLs if not already present, and returns the path to the data directory. Optionally, it can return paths to specific recording formats.
- Parameters:
- data_namestr
Name of the sample dataset to retrieve. Must be one of: - “simple”: Basic sample recording - “PLR”: Pupil light reflex data - “markers”: Recording with fiducial markers for surface mapping
- replacebool, optional
If True, re-download the data even if it already exists locally. Defaults to False.
- format{‘cloud’, ‘native’}, optional
If specified, returns the path to a specific recording format: - “cloud”: Returns path to “Timeseries Data + Scene Video” directory - “native”: Returns path to “Native Recording Data” directory If None, returns the root data directory. Defaults to None.
- Returns:
- Path
Path to the requested data directory.
- Raises:
- ValueError
If data_name is not one of the available sample datasets.
Examples
>>> data_path = get_sample_data("simple") >>> print(data_path) .../data/simple
>>> cloud_path = get_sample_data("PLR", format="cloud") >>> print(cloud_path) .../data/PLR/Timeseries Data + Scene Video