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.

compareTwoConfigs

compare locCfg to defCfg and return a cfg object and modification dict Values are merged from locCfg to defCfg: - parameters already in defCfg get the value from locCfg - additional values in locCfg get added in the resulting Cfg

convertConfigParserToDict

create dictionary from configparser object

convertDF2numerics

convert a string DF to a numerical one

convertDictToConfigParser

create configParser object from dict

convertToCfgList

convert a list into a string where individual list items are separated by |

createConfigurationInfo

Read configurations from all simulations configuration ini files from directory

getDefaultModuleConfig

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

getGeneralConfig

Returns the general configuration for avaframe returns a configParser object

getModPathName

get the path and name of a module from imported module

getModuleConfig

Returns the configuration for a given module returns a configParser object

getNumberOfProcesses

Determine how many CPU cores to take for parallel tasks

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

readCompareConfig

Read and optionally compare configuration files (if a local and default are both provided) and inform user of the eventual differences.

setStrnanToNan

set pandas element to np.nan if it is a string nan

writeAllConfigurationInfo

Write cfg configuration to allConfigurations.csv

writeCfgFile

Save configuration used to text file in Outputs/moduleName/configurationFiles/modName.ini or optional to filePath and with fileName

writeDictToJson

write a dictionary to a json file