edlio package#
Module contents#
Module to work with data in an Experiment Directory Layout (EDL) structure
- class edlio.EDLCollection(name=None)#
Bases:
EDLGroupAn EDL Collection
- __init__(name=None)#
Create a new EDL collection.
If the collection has no name and path set, it can not be saved to disk.
- property collection_idname: str#
Retrieve a human-readable string for this collection which is most likely (but not guaranteed to be) unique. If this collection has no properties set, the value of this property may be None or empty. The format of the returned string is arbitrary and should not be parsed.
- class edlio.EDLDataFile(base_path, media_type=None, file_type=None, unit_attrs=None)#
Bases:
objectA data file, associated with a dataset
- property base_path: Path | None#
Directory that the file parts are stored in, relative to which part names resolve.
- new_part(fname, index=-1, *, allow_exists=False)#
- Return type:
- part_paths()#
Return a generator for the path of each file-part, in their correct sorting order.
- parts: list[EDLDataPart]#
- read(aux_data_entries=None, **kwargs)#
Read all data parts in this set.
This returns a generator which reads all the individual data parts in this data file. The data reader may take auxiliary data into account, if :aux_data is passed.
- Return type:
- class edlio.EDLDataPart(fname, index=-1)#
Bases:
objectDescribes a part of a data block that has been split into multiple files.
- class edlio.EDLDataset(name=None)#
Bases:
EDLUnitAn EDL Dataset
- __init__(name=None)#
Create a new EDL dataset.
If the dataset has no name and path set, it can not be saved to disk.
- property aux_data: list[EDLDataFile]#
- property data: EDLDataFile#
- load(path, mf=None)#
Load an EDL dataset from a path.
- read_aux_data(key=None, **kwargs)#
Read auxiliary data from this dataset.
- Parameters:
key (
str|None) – Identifier key for the auxiliary dataset to load. Will look for a substring match in file_type/media_type properties of the data first, then look for a summary text match to determine which data was requested. If not set, the first dataset is loaded.kwargs (
Any) – Additional keyword arguments forwarded to the data loader (e.g.as_dataframefor CSV/JSON aux data).
- Return type:
- read_data(**kwargs)#
Read data from this dataset.
Returns a generator to read data from this dataset by individual chunks, taking auxiliary data into account.
- Return type:
- exception edlio.EDLError(message)#
Bases:
ExceptionException raised for errors in the input.
- Attributes:
message – explanation of the error
- class edlio.EDLGroup(name=None)#
Bases:
EDLUnitAn EDL Group
- __init__(name=None)#
Create a new EDL group.
If the group has no name and path set, it can not be saved to disk.
- dataset_by_name(name, *, create=False)#
- Return type:
- property datasets: Iterator[EDLDataset]#
- load(path, mf=None)#
Load an EDL unit from a path or path/data combination.
- edlio.load(path)#
Open an EDL unit via its filesystem path.
This function will read an EDL unit on the filesystem and return an object representing it. Depending on the type of the EDL unit, the returned datatype may be a collection, group or dataset.
Submodules#
edlio.collection module#
- class edlio.collection.EDLCollection(name=None)#
Bases:
EDLGroupAn EDL Collection
- __init__(name=None)#
Create a new EDL collection.
If the collection has no name and path set, it can not be saved to disk.
- property collection_idname: str#
Retrieve a human-readable string for this collection which is most likely (but not guaranteed to be) unique. If this collection has no properties set, the value of this property may be None or empty. The format of the returned string is arbitrary and should not be parsed.
edlio.dataset module#
- class edlio.dataset.EDLDataFile(base_path, media_type=None, file_type=None, unit_attrs=None)#
Bases:
objectA data file, associated with a dataset
- property base_path: Path | None#
Directory that the file parts are stored in, relative to which part names resolve.
- new_part(fname, index=-1, *, allow_exists=False)#
- Return type:
- part_paths()#
Return a generator for the path of each file-part, in their correct sorting order.
- parts: list[EDLDataPart]#
- read(aux_data_entries=None, **kwargs)#
Read all data parts in this set.
This returns a generator which reads all the individual data parts in this data file. The data reader may take auxiliary data into account, if :aux_data is passed.
- Return type:
- class edlio.dataset.EDLDataPart(fname, index=-1)#
Bases:
objectDescribes a part of a data block that has been split into multiple files.
- class edlio.dataset.EDLDataset(name=None)#
Bases:
EDLUnitAn EDL Dataset
- __init__(name=None)#
Create a new EDL dataset.
If the dataset has no name and path set, it can not be saved to disk.
- property aux_data: list[EDLDataFile]#
- property data: EDLDataFile#
- load(path, mf=None)#
Load an EDL dataset from a path.
- read_aux_data(key=None, **kwargs)#
Read auxiliary data from this dataset.
- Parameters:
key (
str|None) – Identifier key for the auxiliary dataset to load. Will look for a substring match in file_type/media_type properties of the data first, then look for a summary text match to determine which data was requested. If not set, the first dataset is loaded.kwargs (
Any) – Additional keyword arguments forwarded to the data loader (e.g.as_dataframefor CSV/JSON aux data).
- Return type:
- read_data(**kwargs)#
Read data from this dataset.
Returns a generator to read data from this dataset by individual chunks, taking auxiliary data into account.
- Return type:
edlio.group module#
- class edlio.group.EDLGroup(name=None)#
Bases:
EDLUnitAn EDL Group
- __init__(name=None)#
Create a new EDL group.
If the group has no name and path set, it can not be saved to disk.
- dataset_by_name(name, *, create=False)#
- Return type:
- property datasets: Iterator[EDLDataset]#
- load(path, mf=None)#
Load an EDL unit from a path or path/data combination.
edlio.unit module#
- exception edlio.unit.EDLError(message)#
Bases:
ExceptionException raised for errors in the input.
- Attributes:
message – explanation of the error
edlio.utils module#
- edlio.utils.listify(item)#
- Overloads:
item (list[_T]) → list[_T]
item (_T) → list[_T]
Return a list of :item, unless :item already is a list.