Skip to content

biomodels.runner

Runner producing a SuiteResult from a BioModels selection.

The pipeline itself (sbml2cellml.testsuite.runner.run_suite) is reused unchanged; this module only turns a list of model ids into runnable cases, skipping the ids whose info or download request fails, whose case cannot be built or whose model has no variable (prepare_cases), and runs them (run_biomodels).

prepare_cases

prepare_cases(ids, cache=None)

Build the runnable cases of a list of BioModels ids.

Parameters:

Name Type Description Default
ids list[str]

BioModels ids, e.g. BIOMD0000000001.

required
cache Path | None

cache root, sbml2cellml.testsuite.cases.cache_dir() by default.

None

Returns:

Type Description
list[Case]

The cases built and a skip reason per id whose info or download

dict[str, str]

request failed (download failed: <ExceptionType>), whose case

tuple[list[Case], dict[str, str]]

could not be built (case failed: <ExceptionType>) or whose model

tuple[list[Case], dict[str, str]]

has no variable (no variables); a case with SBML packages is still

tuple[list[Case], dict[str, str]]

returned, sbml2cellml.testsuite.cases.skip_reason skips it later.

run_biomodels

run_biomodels(
    ids,
    cache=None,
    work_dir=Path("biomodels/work"),
    timeout=60.0,
    progress=None,
)

Run the pipeline for a list of BioModels ids.

Parameters:

Name Type Description Default
ids list[str]

BioModels ids to run.

required
cache Path | None

cache root, sbml2cellml.testsuite.cases.cache_dir() by default.

None
work_dir Path

directory for the converted files, created if needed.

Path('biomodels/work')
timeout float

seconds per simulator call.

60.0
progress Callable[[str], None] | None

called with the finished status line of the case after every runnable case, see sbml2cellml.testsuite.runner.run_suite.

None

Returns:

Type Description
SuiteResult

The suite result, suite="biomodels".