carputils
Doxygen code documentation for the python framework controlling openCARP
Functions | Variables
bin.parfile2carputils Namespace Reference

Generate a basic carputils workflow from an openCARP parameter file. More...

Functions

def generate_parser ()
 
def generate_carputils (args)
 Generate a carputils script from an openCARP parameter file. More...
 

Variables

 carputils_template = Template()
 
def parser = generate_parser()
 
def args = parser.parse_args()
 

Detailed Description

Generate a basic carputils workflow from an openCARP parameter file.

The resulting carputils script is independent from the input parameter file, unless the option –keep-parfile is set.

Example of usage: $ parfile2carputils example.par — Generates a carputils script named run.py from the openCARP parameter file example.par. $ parfile2carputils example.par –output run_example.py –overwrite — Generates a carputils script named run_example.py from the openCARP parameter file example.par, overwriting the output file if it already exists. $ parfile2carputils ../example.par –keep-parfile — Generates a carputils script named run.py from the openCARP parameter file ../example.par, copying the parameter file in the current working directory, and using it as an input parameter file in the script. In the end, the current directory will contain a copy of the parameter file and the generated script.

Function Documentation

◆ generate_carputils()

def bin.parfile2carputils.generate_carputils (   args)

Generate a carputils script from an openCARP parameter file.

By default, the resulting carputils script is independent from the input parameter file. If the option args.keep_parfile is set to True, the input parameter file is copied in the output directory and the generated script reads the openCARP parameters from this file.

Requires
args str Path to the openCARP parameter file to read. args str Path to the output file to write. args bool If True, the output file is overwritten if it already exists. args bool If True, the input parameter file is copied in the output directory and the generated script reads the openCARP parameters from this file. args bool If True, the parameter file is overwritten in the output directory if it already exists. This argument is only relevant if args.keep_parfile is set to True. args str Author name to include in the generated script.

◆ generate_parser()

def bin.parfile2carputils.generate_parser ( )

Variable Documentation

◆ args

def bin.parfile2carputils.args = parser.parse_args()

◆ carputils_template

bin.parfile2carputils.carputils_template = Template()

◆ parser

def bin.parfile2carputils.parser = generate_parser()