core.read_config.find_paras_categories

core.read_config.find_paras_categories(paras_dict)

This “inverts” the parameter dictionary, allowing to find in which category a particular parameter lives, thus allowing to find its value in the paras dictionary.

Hence, if you know the name of a parameter and the paras dictionary, you can find the value of the parameter by doing:

cat_dict = find_paras_categories(paras_dict) value_para = paras_dict[cat_dict[value_name]][value_name]

You can also find easily all parameters defined by the paras dictionary by looking at cat_dict.keys().

WARNING: THIS ASSUMES THAT ALL PARAMETERS HAVE A DIFFERENT NAME (ACROSS CATEGORIES).

Parameters:

paras_dict (dict) – first level keys are category and second level keys are names of parameters.

Returns:

cat_dict – keys are names of parameters and values are categories

Return type:

dict