carputils
Doxygen code documentation for the python framework controlling openCARP
Classes | Functions | Variables
carputils.bundle.parfileadjustment Namespace Reference

Functions to adjust an openCARP parameter file to be included in a bundle. More...

Classes

class  _OCParam
 An object of this class represents an openCARP parameter. More...
 

Functions

def get_param (param_str)
 Query openCARP for the parameter named 'param_str' and return an _OCParam describing it. More...
 
def standardize_param_str (s)
 Computes the standardized string representing a parameter. More...
 
def is_file_param (param)
 Tells whether an _OCParam is a file parameter (read/write file or write directory) that requires path adjustment in a bundle. More...
 

Variables

list MESH_EXTENSIONS = ['.elem', '.pts', '.lon', '.belem', '.bpts', '.blon', '.surf']
 
 StringFileParam = namedtuple('StringFileParam', 'name type separator')
 
list STRING_FILEPARAMS
 
dictionary FILE_TYPE_MAP
 

Detailed Description

Functions to adjust an openCARP parameter file to be included in a bundle.

Function Documentation

◆ get_param()

def carputils.bundle.parfileadjustment.get_param (   param_str)

Query openCARP for the parameter named 'param_str' and return an _OCParam describing it.

The information is obtained from the 'openCARP +Help <name>' output, so it does not rely on the global parameter listing (whose format is not guaranteed to be stable across openCARP versions).

Parameters
param_strstr String representing a parameter (e.g. as found in a .par file).
Returns
An _OCParam instance describing the parameter, or None if openCARP does not know this parameter.

◆ is_file_param()

def carputils.bundle.parfileadjustment.is_file_param (   param)

Tells whether an _OCParam is a file parameter (read/write file or write directory) that requires path adjustment in a bundle.

Parameters
param_OCParam A parameter, or None.
Returns
True if the parameter points to a file/directory, False otherwise.

◆ standardize_param_str()

def carputils.bundle.parfileadjustment.standardize_param_str (   s)

Computes the standardized string representing a parameter.

Returns
The string representing the parameter

Variable Documentation

◆ FILE_TYPE_MAP

dictionary carputils.bundle.parfileadjustment.FILE_TYPE_MAP
Initial value:
1 = {
2  'rfile': 'RFile',
3  'wfile': 'WFile',
4  'wdir': 'WDir',
5 }

◆ MESH_EXTENSIONS

list carputils.bundle.parfileadjustment.MESH_EXTENSIONS = ['.elem', '.pts', '.lon', '.belem', '.bpts', '.blon', '.surf']

◆ STRING_FILEPARAMS

list carputils.bundle.parfileadjustment.STRING_FILEPARAMS
Initial value:
1 = [StringFileParam('plug_sv_dumps', 'WFile', ':'),
2  StringFileParam('im_sv_dumps', 'WFile', ',')]
StringFileParam
Definition: parfileadjustment.py:37

◆ StringFileParam

carputils.bundle.parfileadjustment.StringFileParam = namedtuple('StringFileParam', 'name type separator')