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.
- Parameters:
- Return type:
RawEDF
- Returns:
A mne raw object
- 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 inputssample
dictionaries and returns the loaded data.key (
Optional
[str
]) – A unique key identifier for this sample. If not provided, assumessample
is a dictionary with adata
entry and uses its path as key.
- Return type:
- Returns:
In which
key
is as provided anddata
can be accessed to trigger sample loading.