sleepless.data.loader¶
Data loading code.
Functions
|
Loads annotation sample from an EDF or TXT file. |
|
Loads PSG signals sample from an EDF file. |
|
Returns a delayed-loading Sample object. |
Classes
|
- class sleepless.data.loader.Loader(transform_parameters, csv_subset, protocol_name)[source]¶
Bases:
ABC
- sleepless.data.loader.load_edf_raw(path, infer_types, preload, misc=None, exclude=[])[source]¶
Loads PSG signals sample from an EDF file.
- sleepless.data.loader.load_annotation_raw(path)[source]¶
Loads annotation sample from an EDF or TXT file.
- Parameters:
path (
str) – The full path to the EDF or TXT file to be loaded- Return type:
- Returns:
A mne object for annotating segments of raw data
- sleepless.data.loader.make_delayed(sample, loader, key=None, metadata={})[source]¶
Returns a delayed-loading Sample object.
- Parameters:
sample (
dict[str,str]) – A dictionary that maps field names to sample data values (e.g. paths)loader (
Callable) – A function that inputssampledictionaries and returns the loaded data.key (
str|None) – A unique key identifier for this sample. If not provided, assumessampleis a dictionary with adataentry and uses its path as key.
- Return type:
- Returns:
In which
keyis as provided anddatacan be accessed to trigger sample loading.