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

Functions

def carputils_root_dir ()
 
def filename ()
 Determine carputils settings file name. More...
 
def assert_type (name, value, type, sequence=False)
 Raise an error if the value is not of the correct type. More...
 
def load ()
 Load the settings file. More...
 
def default_settings (software_root=None, regression_ref=None, regression_pkg=['devtests'], regression_temp=None, meshalyzer_dir=None, mesh_dir=None, meshtool_dir=None, limpetgui_dir=None, opencarp_src=None, mpiexec=None, flavor=None, email=None, name=None, orcid=None)
 Determine the default configuration options for the settings.yaml file. More...
 
def new (filename, args, kwargs)
 Generate a new settings file with the default settings. More...
 
def update (filename)
 Update the keys in the settings file using the backwards compatability list. More...
 
def yaml_format_seq (seq)
 Format a sequence in YAML syntax. More...
 
def yaml_format_dict (seq)
 Format a dictionary in YAML syntax. More...
 
def write_settings_yaml (fields, filename)
 Write the settings file with the provided fields. More...
 

Variables

dictionary BACKWARDS_COMPAT_MAPPING
 
list BACKWARDS_COMPAT_REMOVED
 
dictionary VALIDATION_SINGLE
 
dictionary VALIDATION_SEQUENCE
 
list PATHS
 
string NOSETTINGS_TEMPLATE
 

Function Documentation

◆ assert_type()

def carputils.settings.config.assert_type (   name,
  value,
  type,
  sequence = False 
)

Raise an error if the value is not of the correct type.

Parameters

name str Name of the variable, used for error messages value object Object to test type of type type Type to check value is sequence bool, optional If True, expect value to be a sequence of type

◆ carputils_root_dir()

def carputils.settings.config.carputils_root_dir ( )

◆ default_settings()

def carputils.settings.config.default_settings (   software_root = None,
  regression_ref = None,
  regression_pkg = ['devtests'],
  regression_temp = None,
  meshalyzer_dir = None,
  mesh_dir = None,
  meshtool_dir = None,
  limpetgui_dir = None,
  opencarp_src = None,
  mpiexec = None,
  flavor = None,
  email = None,
  name = None,
  orcid = None 
)

Determine the default configuration options for the settings.yaml file.

Parameters

software_root str, optional Default path for built software packages regression_ref str, optional Location of regression reference solution repositories regression_pkg list, optional Default packages to load tests from regression_temp str, optional Temporary location to store simulation results meshalyzer_dir str, optional Parent directory of meshalyzer executable meshtool_dir str, optional Parent directory of meshtool executable limpetgui_dir str, optional Parent directory of main.py executable opencarp_src str, optional Directory containing openCARP source files mesh_dir str, optional Default path to look for meshes flavor str, optional Default solver used (pt, petsc, direct, or ginkgo) email str, optional Email address consistent with your git configuration (.gitconfig) name str, optional User name consistent with your git configuration (.gitconfig) orcid str, optional ORCID of the user

Returns
-------
dict
    The default settings

◆ filename()

def carputils.settings.config.filename ( )

Determine carputils settings file name.

Returns

str The settings file path

◆ load()

def carputils.settings.config.load ( )

Load the settings file.

Returns

SettingsNamespace The loaded settings

◆ new()

def carputils.settings.config.new (   filename,
  args,
  kwargs 
)

Generate a new settings file with the default settings.

Extra arguments are passed through to default_settings

Parameters

filename str The path of the settings file to generate

◆ update()

def carputils.settings.config.update (   filename)

Update the keys in the settings file using the backwards compatability list.

Parameters

filename str The path of the settings file to update

◆ write_settings_yaml()

def carputils.settings.config.write_settings_yaml (   fields,
  filename 
)

Write the settings file with the provided fields.

Parameters

fields dict Data to insert into configuration file template filename str Filename to write file to

◆ yaml_format_dict()

def carputils.settings.config.yaml_format_dict (   seq)

Format a dictionary in YAML syntax.

◆ yaml_format_seq()

def carputils.settings.config.yaml_format_seq (   seq)

Format a sequence in YAML syntax.

Variable Documentation

◆ BACKWARDS_COMPAT_MAPPING

dictionary carputils.settings.config.BACKWARDS_COMPAT_MAPPING
Initial value:
1 = {'MPI_EXEC': 'MPIEXEC',
2  'HW_DEFAULT': 'PLATFORM',
3  'SILENT_DEFAULT': 'SILENT',
4  'VIS_DEFAULT': 'VISUALIZE',
5  'FLAVOR_DEFAULT': 'FLAVOR',
6  'DIRECT_DEFAULT': 'DIRECT_SOLVER',
7  'PURK_DEFAULT': 'PURK_SOLVER',
8  'LIMPET_GUI_DIR': 'LIMPETGUI_DIR'}

◆ BACKWARDS_COMPAT_REMOVED

list carputils.settings.config.BACKWARDS_COMPAT_REMOVED
Initial value:
1 = ['HOME',
2  'CARP_TYPE',
3  'WITH_MECH',
4  'DEBUG']

◆ NOSETTINGS_TEMPLATE

string carputils.settings.config.NOSETTINGS_TEMPLATE
Initial value:
1 = """ERROR: No carputils settings file was found.
2 The resolution order is:
3  - The full path (not just the directory) set by the environment variable
4  CARPUTILS_SETTINGS
5  - settings.yaml in the root of the carputils repository
6  - ./settings.yaml
7  - ~/.config/carputils/settings.yaml
8 The following paths were tried:
9  - {}
10 Creating your settings file at ~/.config/carputils/settings.yaml is recommended.
11 To do so, please run:
12  cusettings ~/.config/carputils/settings.yaml
13 """

◆ PATHS

list carputils.settings.config.PATHS
Initial value:
1 = ['CARP_EXE_DIR',
2  'MESHALYZER_DIR',
3  'LIMPETGUI_DIR',
4  'TUNING_DIR',
5  'MESH_DIR',
6  'OPENCARP_SRC',
7  'REGRESSION_TEMP',
8  'REGRESSION_REF']

◆ VALIDATION_SEQUENCE

dictionary carputils.settings.config.VALIDATION_SEQUENCE
Initial value:
1 = {'CARP_EXE_DIR': str,
2  'REGRESSION_PKG': str}

◆ VALIDATION_SINGLE

dictionary carputils.settings.config.VALIDATION_SINGLE
Initial value:
1 = {'MESHALYZER_DIR': str,
2  'LIMPETGUI_DIR': str,
3  'TUNING_DIR': str,
4  'MESH_DIR': str,
5  'MESHTOOL_DIR': str,
6  'OPENCARP_SRC': str,
7  'REGRESSION_TEMP': str,
8  'REGRESSION_REF': str,
9  'MPIEXEC': str,
10  'SILENT': bool,
11  'VISUALIZE': bool,
12  'FLAVOR': str,
13  'PLATFORM': str,
14  'BUILD': str,
15  'DIRECT_SOLVER': str,
16  'PURK_SOLVER': str,
17  'EMAIL': str,
18  'NAME': str,
19  'ORCID': str,
20  'MAX_NP': int}