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

openCARP parameters helper More...

Functions

def highlight_keywords (string)
 For each keyword in the predefined list KEYWORDS, find the pattern keyword+':' in the string and highlight keyword. More...
 
def highlight_types (string, prefix='', suffix='')
 For each element dtype in DTYPES, highlight dtype if prefix+dtype+suffix is contained in string. More...
 
def build_helpcmd (carpexec, args)
 
def main (carpexec, arg, colors=True)
 Prints documentation about matching openCARP parameters. More...
 
def print_help ()
 

Variables

string GRCOL = '\33[1;32m'
 
string YLCOL = '\33[1;33m'
 
string BLCOL = '\33[1;34m'
 
string NOCOL = '\33[0m'
 
tuple KEYWORDS
 
tuple DTYPES
 
 cli
 
 carpexec = settings.execs['CARP']
 
 args = sys.argv[1:]
 
bool colors = True
 

Detailed Description

openCARP parameters helper

This script allows you to find openCARP parameters containing a given search pattern, and to get their documentation. Use "+" to concatenate multiple search patterns.

Usage
> carphelp pattern pattern ... [–no-col]

Examples

> carphelp imp_region stim+type

Function Documentation

◆ build_helpcmd()

def bin.carphelp.build_helpcmd (   carpexec,
  args 
)

◆ highlight_keywords()

def bin.carphelp.highlight_keywords (   string)

For each keyword in the predefined list KEYWORDS, find the pattern keyword+':' in the string and highlight keyword.

Parameters
stringstr string in which keywords should be highlighted
Returns
string str the string with keywords highlighted
totcount int the number of keywords found in the string

◆ highlight_types()

def bin.carphelp.highlight_types (   string,
  prefix = '',
  suffix = '' 
)

For each element dtype in DTYPES, highlight dtype if prefix+dtype+suffix is contained in string.

Returns
string str string in which matching patterns are highlighted
totcount str number of matching patterns

◆ main()

def bin.carphelp.main (   carpexec,
  arg,
  colors = True 
)

Prints documentation about matching openCARP parameters.

Parameters
carpexecstr openCARP executable
argstr search patterns for parameters
colorsbool if True, highlighting is used on the output

◆ print_help()

def bin.carphelp.print_help ( )

Variable Documentation

◆ args

bin.carphelp.args = sys.argv[1:]

◆ BLCOL

string bin.carphelp.BLCOL = '\33[1;34m'

◆ carpexec

bin.carphelp.carpexec = settings.execs['CARP']

◆ cli

bin.carphelp.cli

◆ colors

bool bin.carphelp.colors = True

◆ DTYPES

tuple bin.carphelp.DTYPES
Initial value:
1 = ('Short', 'Int', 'Size_t', 'Float', 'Double',
2  'WFile', 'RFile', 'String', 'Flag')

◆ GRCOL

string bin.carphelp.GRCOL = '\33[1;32m'

◆ KEYWORDS

tuple bin.carphelp.KEYWORDS
Initial value:
1 = ('type', 'min', 'max', 'default',
2  'units', 'menu', 'ext', 'Depends on',
3  'Changes the allocation of', 'Influences the value of',
4  'Changes the default value of')

◆ NOCOL

string bin.carphelp.NOCOL = '\33[0m'

◆ YLCOL

string bin.carphelp.YLCOL = '\33[1;33m'