Skip to content

omnipy.components.isa.flows

Flows for transforming ISA-JSON datasets into flattened tabular-like structures.

FUNCTION DESCRIPTION
flatten_isa_json

Flatten ISA-JSON documents into tabular-like records.

flatten_isa_json

flatten_isa_json(dataset: IsaJsonDataset) -> FlattenedIsaJsonDataset

Flatten ISA-JSON documents into tabular-like records.

The flow converts each ISA document to an intermediate dictionary-of-dictionaries representation, transposes that structure into record lists, and then flattens nested keys into scalar columns.

PARAMETER DESCRIPTION
dataset

Dataset with ISA-JSON documents to flatten.

TYPE: IsaJsonDataset

RETURNS DESCRIPTION
FlattenedIsaJsonDataset

A dataset containing flattened ISA records suitable for tabular workflows.

Source code in src/omnipy/components/isa/flows.py
@LinearFlowTemplate(
    convert_dataset.refine(fixed_params=dict(dataset_cls=JsonDictOfDictsDataset)),
    transpose_dict_of_dicts_2_list_of_dicts,
    flatten_nested_json,
    convert_dataset.refine(fixed_params=dict(dataset_cls=FlattenedIsaJsonDataset)))
def flatten_isa_json(dataset: IsaJsonDataset) -> FlattenedIsaJsonDataset:
    """Flatten ISA-JSON documents into tabular-like records.

    The flow converts each ISA document to an intermediate dictionary-of-dictionaries
    representation, transposes that structure into record lists, and then flattens
    nested keys into scalar columns.

    Args:
        dataset: Dataset with ISA-JSON documents to flatten.

    Returns:
        A dataset containing flattened ISA records suitable for tabular workflows.
    """
    ...