# mpycopy This tools copies a given case setup to a new location. Templated case setups are rendered so that the setup is ready-to-run. The tool uses [Astropy](https://docs.astropy.org/en/stable/index.html) for reading case parameters from a `caseParameterTable.ecsv` file. [Copier](https://copier.readthedocs.io/en/stable/) is then used to create a copy of the template and filling in parameter values into a `caseParameterDict.jinja` file, creating a readable `caseParameterDict`. The copy process: - Copies simple case setups without modification - Renders templated cases with Jinja2 variable substitution - Reads parameters from caseParameterTable.ecsv ## Usage ```bash 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: ```bash mpycopy --case case1 ./template ./run/case1 ``` ### Render All Cases from Template Render all cases defined in the parameter table: ```bash 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: ```text case velocity temperature ---- -------- ----------- low 0.5 300 high 1.0 350 ``` **caseParameterDict.jinja** - Jinja2 template file: ```text velocity {{ velocity }}; temperature {{ temperature }}; ``` After rendering, the template file `caseParameterDict.jinja` becomes `caseParameterDict` with values filled in: ```text velocity 0.5; temperature 300; ```