eegunity package#

Subpackages#

Submodules#

eegunity.unifieddataset module#

class eegunity.unifieddataset.UnifiedDataset(dataset_path: str | None = None, locator_path: str | None = None, domain_tag: str | None = None, is_unzip: bool = True, verbose: str = 'CRITICAL', num_workers: int = 0, kernel_spec: str | None = None)[source]#

Bases: _UDatasetSharedAttributes

This is the kernel class to manage mutiple EEG datasets and associated processing tools.

Attributes:#

dataset_pathstr, optional

Path to the dataset (folder). Should not be provided alongside locator_path.

locator_pathstr, optional

Path to the locator. Should not be provided alongside dataset_path.

is_unzipbool, optional

If set to True, any Zip files in the specified dataset will be unzipped. Be aware that unzipping may modify the dataset.

domain_tagstr, optional

The domain tag identifies the dataset name and is required if you specify a dataset path.

verbosestr, optional

Level of verbosity for logging (default is ‘CRITICAL’).

eeg_parserEEGParser

EEGParser module

eeg_batchEEGBatch

EEGBatch module

eeg_correctionEEGCorrection

EEGCorrection module

llm_boosterEEGLLMBooster

EEGLLMBooster module

clear_kernel()[source]#

Unbind the current kernel from this dataset.

copy()[source]#

Create a deep copy of the UnifiedDataset instance.

Returns:#

UnifiedDataset

A deep copy of the current UnifiedDataset instance.

get_kernel()[source]#

Return the currently bound kernel object or None.

get_locator()[source]#

Return the locator in DataFrame.

Returns:#

pandas.DataFrame

The locator DataFrame associated with the dataset.

group_by_domain()[source]#

Groups the locator data by the ‘domain_tag’ and returns multiple UnifiedDataset instances.

Returns:#

List[UnifiedDataset] : A list of UnifiedDataset instances, each grouped by domain.

load_kernel(kernel_spec: str)[source]#

Load an external kernel and bind it to this dataset.

Parameters:

kernel_spec – Spec string in the form "<path_or_module>:<object_name>". This can be called at construction time or any time later.

Returns:

The loaded kernel object.

Return type:

Any

Raises:

ValueError – If the loaded object does not implement apply(udataset, raw, row).

save_locator(path)[source]#

Save the locator of this UnifiedDataset to a CSV file at the specified path. This file is helpful for checking the current status and metadata after data processing. You can also reload the UnifiedDataset later by using this locator file, for example: unified_dataset = UnifiedDataset(locator_path=”your_locator_path”)

Parameters:#

pathstr

The file path where the locator should be saved.

set_locator(new_locator)[source]#

Set a new locator for this UnifiedDataset instance. This allows you to update the metadata for the entire dataset without altering the original raw file.

Parameters:#

new_locatorpandas.DataFrame

The new locator DataFrame to associate with the dataset.

Module contents#