in3Utils.cfgUtils

Utilities for handling configuration files

Functions

appendCgf2DF

append simulation configuration to the simulation dataframe only account for sections GENERAL and INPUT

appendTcpu2DF

append Tcpu dictionary to the dataframe

cfgHash

UID hash of a config. Given a configParser object cfg,

compareConfig

Compare configuration files (if a local and default are both provided) and inform user of the eventuel differences.

convertConfigParserToDict

create dictionary from configparser object

convertDF2numerics

convert a string DF to a numerical one

convertDictToConfigParser

create configParser object from dict

createConfigurationInfo

Read configurations from all simulations configuration ini files from directory

filterCom1DFAThicknessValues

thickness settings different if read from shpfile - requires more complex filtering if read from shp - thickness values are provided per feature!! for example relTh = ‘’ but relTh0 = 1 is appended for feature with id 0, relTh1 for feature with id 1, etc.

filterSims

Filter simulations using a list of parameters and a pandas dataFrame of simulation configurations if ~ is used as a prefix for a parameter - it is filtered according to values that do NOT match the value provided with the ~Parameter

getDefaultModuleConfig

Returns the default configuration for a given module returns a configParser object

getGeneralConfig

Returns the general configuration for avaframe returns a configParser object

getModuleConfig

Returns the configuration for a given module returns a configParser object

orderSimFiles

Filter simulations results using a list of parameters and a flag if in ascending or descending order

readAllConfigurationInfo

Read allConfigurations.csv file as dataFrame from directory

readCfgFile

Read configuration from ini file, if module is provided, module configuration is read from Ouputs, if fileName is provided configuration is read from fileName

removeSimsNotMatching

remove simulations from simDF that do not match filtering critera

writeAllConfigurationInfo

Write cfg configuration to allConfigurations.csv

writeCfgFile

Save configuration used to text file in Outputs as moduleName_settings.ini or optional in Outputs/moduleName/configurationFiles/filenName.ini

writeDictToJson

write a dictionary to a json file