phasorpy.datasets#

Manage sample data files for testing and tutorials.

The phasorpy.datasets module provides a fetch() function to download data files from remote repositories and cache them in a local directory. The cache location can be changed by setting the PHASORPY_DATA_DIR environment variable.

Datasets from the following repositories are available:

The implementation is based on the Pooch library.

phasorpy.datasets.fetch(*args, extract_dir='.', return_scalar=True, **kwargs)[source]#

Return absolute path(s) to sample file(s) in local storage.

The files are downloaded from a remote repository if they do not already exist in the local storage.

Parameters:
  • *args (str or iterable of str, optional) – Name(s) of file(s) or repositories to fetch from local storage. If omitted, return files in all repositories.

  • extract_dir (str or None, optional) – Path, relative to cache location, where ZIP files will be unpacked.

  • return_scalar (bool, optional) – If true (default), return single path as string, else tuple of string.

  • **kwargs (optional) – Additional arguments passed to pooch.fetch(). For example, progressbar=True.

Returns:

Absolute path(s) of file(s) in local storage.

Return type:

str or tuple of str

Examples

>>> fetch('simfcs.r64')
'...simfcs.r64'
>>> fetch('simfcs.r64', 'simfcs.ref')
('...simfcs.r64', '...simfcs.ref')
phasorpy.datasets.REPOSITORIES#

Pooch repositories.