metadata

parse.metadata

Functions

Name Description
add_to_parameters_collection Adds a value to a Bunch object using the provided path, without inserting a redundant sub-level.
import_yaml_coupling Import a coupling function from metadata into the ontology.
import_yaml_model Import a model from metadata into the ontology.
simulator2metadata Convert a TVB simulator into a tvbo_datamodel.SimulationExperiment.
traverse_metadata Recursively traverses the attributes of a metadata object, calling a callback on each Parameter.

add_to_parameters_collection

parse.metadata.add_to_parameters_collection(key, value, path, parameters)

Adds a value to a Bunch object using the provided path, without inserting a redundant sub-level.

import_yaml_coupling

parse.metadata.import_yaml_coupling(experiment_metadata, coupling_name=None)

Import a coupling function from metadata into the ontology.

Parameters

Name Type Description Default
experiment_metadata Any A SimulationExperiment, Coupling, dict, or path to a YAML file from which to read the coupling metadata. required
coupling_name str Name to use for the created ontology class. If None, the name is derived from the metadata. Defaults to None. None

Returns

Name Type Description
Any owlready2.entity.ThingClass: The created ontology coupling class.

import_yaml_model

parse.metadata.import_yaml_model(experiment_metadata, model_name=None)

Import a model from metadata into the ontology.

Loads model information and creates ontology subclasses for state variables, parameters, derived variables, and output transforms.

Parameters

Name Type Description Default
experiment_metadata Any A SimulationExperiment, Dynamics, or path to a YAML file from which to read the model metadata. required
model_name str Name to use for the created ontology class. If None, the name is derived from the metadata. Defaults to None. None

Returns

Name Type Description
Any owlready2.entity.ThingClass: The created ontology model class.

simulator2metadata

parse.metadata.simulator2metadata(sim, experiment_id=None, odir=None)

Convert a TVB simulator into a tvbo_datamodel.SimulationExperiment.

Aligns with the schema-only runtime design: uses datamodel classes directly and populates only schema fields.

traverse_metadata

parse.metadata.traverse_metadata(
    metadata,
    target_instance=tvbo_datamodel.Parameter,
    path=None,
    callback=add_to_parameters_collection,
    callback_kwargs={},
    keys_to_exclude=(),
)

Recursively traverses the attributes of a metadata object, calling a callback on each Parameter.