mpycopy
This tools copies a given case setup to a new location. Simple case setups are copied without modification. Templated case setups, i.e. setups that feature
a top-level
caseParameterTable.ecsvfile in the Astropy ECSV format that lists all case variations with the corresponding parametersone or more files with the ending
.jinjacontaining placeholders for these parameters
are rendered into a ready-to-run state using the Jinja templating engine.
Usage
mpycopy input output [options]
where input is the (templated) case to be copied to the output directory.
Examples
Render a Single Case from Template
Render a specific case from a templated setup:
mpycopy --case case1 ./template ./run/case1
Render All Cases from Template
Render all cases defined in the parameter table:
mpycopy ./template ./run
This will create subdirectories in ./run for each case defined in caseParameterTable.ecsv.
Template Structure
A templated case should contain:
caseParameterTable.ecsv - Table with case parameters:
case velocity temperature
---- -------- -----------
low 0.5 300
high 1.0 350
caseParameterDict.jinja - Jinja2 template file:
velocity {{ velocity }};
temperature {{ temperature }};
After rendering, the template file caseParameterDict.jinja becomes
caseParameterDict with values filled in:
velocity 0.5;
temperature 300;