coco_pipe.io.structures#

Standardized containers for passing data between Datasets, Preprocessing, and main modules.

This module provides the ~coco_pipe.io.DataContainer, an N-dimensional tensor wrapper that manages metadata, coordinates, and labels alongside the raw data matrix. It serves as the common currency for the entire pipeline.

Examples

>>> import numpy as np
>>> from coco_pipe.io import DataContainer

# 1. Creating a container for EEG Epochs (N_epochs, N_channels, N_time) >>> X = np.random.randn(10, 64, 500) >>> container = DataContainer( … X=X, … dims=(“obs”, “channel”, “time”), … coords={ … “channel”: [“Fz”, “Cz”, “Pz”], # … etc … “time”: np.linspace(0, 1.0, 500), … }, … y=np.random.randint(0, 2, 10), … ids=[f”sub-01_trial-{i}” for i in range(10)], … )

# 2. Creating a container for simple Tabular Features (N_subjects, N_features) >>> X_tab = np.random.randn(20, 5) >>> container_tab = DataContainer( … X=X_tab, … dims=(“obs”, “feature”), … coords={“feature”: [“age”, “IQ”, “response_time”, “power_alpha”, “power_beta”]}, … )

Attributes#

Module Contents#

coco_pipe.io.structures.logger#