environmentaltools.common.string_to_function

environmentaltools.common.string_to_function(param: dict, variable: str = None)[source]

Convert string function names to scipy.stats function objects.

Replaces string representations of statistical distribution names with actual scipy.stats function objects in parameter dictionary.

Parameters:
  • param (dict) – Parameter dictionary containing ‘fun’ key with function name strings to convert.

  • variable (str, optional) – Specific variable name to process. If None, processes all entries in param[‘fun’]. Defaults to None.

Returns:

Updated parameter dictionary with function objects instead of strings.

Return type:

dict