Skip to content

physiome.runner

The pipeline of the Physiome check, which starts from the CellML model.

The five stages mirror the ones of the test suite, in the order of the conversion of a CellML model (sbml2cellml.testsuite.results.CELLML_STAGES):

  1. libopencor simulates the model of the repository; its result is what the later stages are compared with, since the repository has no expected results.
  2. cellml2sbml converts the model to SBML.
  3. sbmlsim simulates the SBML model and compares it.
  4. sbml2cellml converts the SBML model back to CellML.
  5. roundtrip simulates that model with libopencor and compares it.

The CellML simulation names a variable by its name, or by component/name when more than one variable of the model has that name, and the SBML simulation by the id of its equivalence set; PhysiomeCase.columns maps the first to the second, so that every comparison runs on the same columns.

skip_reason

skip_reason(err)

The reason a model is skipped, the kind of the problem.

Parameters:

Name Type Description Default
err BaseException

the error of the clone or of the construction of the case.

required

Returns:

Type Description
str

The reason of SKIP_REASONS whose phrase the error holds, else the

str

first line of the message.

prepare_cases

prepare_cases(exposures, cache=None)

Clone the workspaces of the exposures and build their cases.

A model which cannot be cloned, read or analysed is skipped with the kind of its problem (skip_reason), its complete error is logged.

Parameters:

Name Type Description Default
exposures list[Exposure]

the exposures of the selection.

required
cache Path | None

cache root of the workspaces.

None

Returns:

Type Description
tuple[list[PhysiomeCase], dict[str, str]]

The cases and the skipped exposures with the reason, by id.

run_case

run_case(case, work_dir, sbmlsim, libopencor)

Run the five stages of a case of the repository.

Parameters:

Name Type Description Default
case PhysiomeCase

the case with the CellML model.

required
work_dir Path

directory for the converted files.

required
sbmlsim SimulatorWorker

worker for the SBML simulation.

required
libopencor SimulatorWorker

worker for the CellML simulations.

required

Returns:

Type Description
CaseResult

The stage results; a stage whose input stage failed is skip. The

CaseResult

libopencor simulation of the model gives the expected results, so

CaseResult

every later stage is skipped when it fails.

run_physiome

run_physiome(
    exposures,
    work_dir,
    cache=None,
    timeout=60.0,
    progress=None,
)

Run the pipeline for every model of the selection.

Parameters:

Name Type Description Default
exposures list[Exposure]

the exposures of the selection.

required
work_dir Path

directory for the converted files, created if needed.

required
cache Path | None

cache root of the workspaces.

None
timeout float

seconds per simulator call.

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

called with the status line of every case.

None

Returns:

Type Description
SuiteResult

The result, with the stages of a run which starts from CellML.