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):
libopencorsimulates the model of the repository; its result is what the later stages are compared with, since the repository has no expected results.cellml2sbmlconverts the model to SBML.sbmlsimsimulates the SBML model and compares it.sbml2cellmlconverts the SBML model back to CellML.roundtripsimulates 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
¶
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 |
str
|
first line of the message. |
prepare_cases
¶
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 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 |
CaseResult
|
libopencor simulation of the model gives the expected results, so |
CaseResult
|
every later stage is skipped when it fails. |
run_physiome
¶
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. |