in3Utils.cfgHandling¶
Utilities for working with cfg info
Functions
Add parameterName and value to simNames of simulation dataframe |
|
override configuration parameter values with the values provided in cfgWithOverrideParameters[modName_override] if addModValues True update the cfgWithOverrideParameters with the values for all parameters that are not provided in the override parameters |
|
Filter simulations results using a list of parameters and a flag if in ascending or descending order :Parameters: * avalancheDir (str) – path to avalanche directory * inputDir (str) – path to simulation results * varParList (str or list) – simulation configuration parameters for ordering simulations * ascendingOrder (bool) – True if simulations shall be ordered in ascending order regarding varPar * specDir (str) – path to a directory where simulation configuration files can be found - optional |
|
create a validation string to be checked if simDFrow matches filtering criteria (given by val) |
|
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. |
|
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 |
|
Add keys and values to name, in between parts of name split by index |
|
Filter simulations results using a list of parameters and a flag if in ascending or descending order |
|
Order simulations datadframe using a list of parameters and a flag if in ascending or descending order :Parameters: * varParList (str or list) – simulation configuration parameters for ordering simulations * ascendingOrder (bool) – True if simulations shall be ordered in ascending order regarding varPar * simDF (pandas dataFrame) – dataFrame of simulations (one line per simultaion with fileName, … and values for parameters in varParList). |
|
remove simulations from simDF that do not match filtering critera |