study

classes.study

Classes

Name Description
SimulationStudy A collection of related SimulationExperiments with shared provenance.

SimulationStudy

classes.study.SimulationStudy(
    description=None,
    citekey=None,
    type=None,
    title=None,
    authors=empty_list(),
    year=None,
    doi=None,
    label=None,
    derived_from=None,
    model=None,
    references=empty_list(),
    key=None,
    sample=None,
    experiments=empty_dict(),
)

A collection of related SimulationExperiments with shared provenance.

Aggregates the experiments behind a published paper or analysis (model, DOI, year, citation, dataset) into one declarative YAML/Pydantic object. Load with from_db(name) for curated studies, from_file(path) for local YAML, or from_openminds(...) for JSON-LD provenance graphs.

The most-used entry points are get_experiment(id) to materialise a single run, cite() for the formatted citation, and to_openminds(...) for JSON-LD export.

Methods

Name Description
from_db Load a SimulationStudy by name from the tvbo database.
from_openminds Create a SimulationStudy from openMINDS JSON-LD.
get_experiment Retrieve a single experiment by its declared id.
list_db List available studies in the tvbo database.
to_openminds Export study to openMINDS JSON-LD format.
from_db
classes.study.SimulationStudy.from_db(name)

Load a SimulationStudy by name from the tvbo database.

from_openminds
classes.study.SimulationStudy.from_openminds(source)

Create a SimulationStudy from openMINDS JSON-LD.

Parameters

source : str or dict Either a file path to a JSON-LD file, or a dict containing JSON-LD data.

Returns

SimulationStudy New instance constructed from the openMINDS data.

Example

study = SimulationStudy.from_openminds(“study.jsonld”) study = SimulationStudy.from_openminds({“type?”: “tvbo:SimulationStudy”, …})

get_experiment
classes.study.SimulationStudy.get_experiment(experiment_id)

Retrieve a single experiment by its declared id.

list_db
classes.study.SimulationStudy.list_db()

List available studies in the tvbo database.

to_openminds
classes.study.SimulationStudy.to_openminds(
    filepath=None,
    base_id=None,
    include_context=True,
)

Export study to openMINDS JSON-LD format.

Parameters

filepath : str, optional If provided, write JSON-LD to this file path. base_id : str, optional Base URI for generating id? values (e.g., “https://example.org/studies”). If not provided and study has a DOI, uses the DOI as id?. include_context : bool Whether to include the context? in the output. Default True.

Returns

dict OpenMINDS-compatible JSON-LD dictionary.

Example

study = SimulationStudy.from_file(“study.yaml”) jsonld = study.to_openminds() study.to_openminds(“output.jsonld”, base_id=“https://example.org”)