cherab.inversion.data.get_sample_dataΒΆ

cherab.inversion.data.get_sample_data(fname: str, asfileobj=True, *, np_load=True)SourceΒΆ

Retrieve a sample data file.

Sample data files are stored in the cherab/inversion/data directory within the cherab-inversion package.

If the filename ends in .gz, the file is implicitly ungzipped. If the filename ends with .npy or .npz, and asfileobj is True, the file is loaded with numpy.load.

Parameters:
fname: strΒΆ

Path relative to the cherab/inversion/data directory.

asfileobj=TrueΒΆ

If True, return a file object, otherwise return a file path.

np_load=TrueΒΆ

If True, load .npy or .npz files with numpy.load.

Returns:

str or file object – Path to the file or file object.

Examples

>>> data = get_sample_data("bolo.npz")