The parameter handling in openCARP and mesher has been reworked with one
goal in mind: make it easier to run, share, and maintain simulations without
changing how existing studies are launched. The changes described below are
available in builds from the latest state of the master branch and will be included
in the next release version.
From a user perspective, the biggest changes are straightforward:
+F / --file can now read .par, .toml, and .json--...
style in addition to the legacy +... forms+Doc <topic> and --doc <topic> give more focused parameter help.par files and the old command line interface remain fully supported, so existing
workflows do not need to be rewritten.
Historically, parameter files were written as .par files:
dt = 25
num_imp_regions = 1
imp_region[0].name = tissue
imp_region[0].im = LuoRudy91
imp_region[0].im_param = "flags=EPI"
That format still works, but openCARP can now also read:
.toml.jsonThe parser is selected automatically from the file suffix when you call:
openCARP --file experiment.par
openCARP --file experiment.toml
openCARP --file experiment.json
This makes it easier to choose the right format for the job:
.par when you want full backward compatibility.toml when humans will edit the file regularly.json when the file is generated by scripts or other toolsThe modern formats are especially helpful for repeated sections like
imp_region, stim, stimulus, or gregion.
dt = 25
[[imp_region]]
name = "endo"
im = "LuoRudy91"
im_param = "flags=ENDO"
ID = [1, 2]
[[imp_region]]
name = "epi"
im = "LuoRudy91"
im_param = "flags=EPI"
ID = [5, 6, 7]
{
"dt": 25,
"imp_region": [
{
"name": "endo",
"im": "LuoRudy91",
"im_param": "flags=ENDO",
"ID": [1, 2]
},
{
"name": "epi",
"im": "LuoRudy91",
"im_param": "flags=EPI",
"ID": [5, 6, 7]
}
]
}
In these formats, repeated parameter groups are naturally expressed as lists of objects instead of manually managing long sequences of indexed assignments.
The old input style requires explicit controller fields such as:
num_imp_regionsnum_stimimp_region[i].num_IDsThe new parser can infer these counts from the actual data.
So instead of writing:
num_imp_regions = 2
imp_region[0].num_IDs = 2
imp_region[1].num_IDs = 3
you can just provide the list content itself and let the parser determine the required sizes.
That makes modern parameter files shorter and less error-prone, especially for large region lists and nested arrays.
The parser still accepts the traditional +... control syntax, but it now also
supports a --... style for the same actions. This makes the interface feel
more familiar to users coming from tools such as bench, which uses a
gengetopt-style command line.
Examples:
openCARP +F experiment.par
openCARP --file experiment.par
openCARP +Doc dt
openCARP --doc dt
openCARP +Help
openCARP --help
The new long forms currently cover the command-line control actions around files, documentation, help, saving, defaults, and interactive/run modes. The legacy forms remain valid, so existing scripts do not need to change.
The command-line help path has also been cleaned up.
The legacy forms still work, but you can now also use long options such as:
openCARP --help
openCARP --doc dt
openCARP +Doc dt
Scoped documentation is useful when you only want details for a specific parameter instead of the full help text.
The parameter schema now supports extra metadata that can be surfaced to users:
That metadata is shown in parameter documentation and is also propagated into the generated XML used for the manual and the website parameter overview.
For users, that means parameter docs can now in principle tell you:
At runtime, openCARP can also suggest citations at the end of a simulation
when you explicitly activated a parameter that carries citation metadata.
For now, we have the infrastructure ready and will populate these fields step
by step in the future.
During the rollout, openCARP currently evaluates the new parser and the
legacy param() path side by side and compares the resulting parameter state
before the simulation proceeds.
For legacy-compatible startup input, this comparison is done against the
original command line and original .par file input, not against a
parser-generated surrogate file.
There are a few cases where no true legacy baseline exists and the comparison is therefore skipped:
.toml input files.json input filesnum_gregions etc.)If a mismatch is detected, the simulation stops by default. Users are asked to open an issue on the openCARP GitLab project and include the triggering command line and parameter files:
https://git.opencarp.org/openCARP/openCARP/-/work_items
--run remains available as the explicit run directive, but it does not bypass
this mismatch check. If you need to continue temporarily despite a mismatch,
use the legacy fallback path instead, either via the command line or via an
environment variable:
openCARP --param-fallback=legacy --run --file experiment.par
OPENCARP_PARAM_FALLBACK=legacy openCARP --run --file experiment.par
The update is meant to improve usability, not force immediate migration.
.par files still workIf you already have a stable workflow, you can keep it. If you are starting a new project, you now have better options.
© Copyright 2020 openCARP project Supported by DFG and EuroHPC Contact Imprint and data protection