yatsm.config_parser module

yatsm.config_parser.convert_config(cfg)[source]

Convert some configuration values to different values

Parameters:cfg – dict of sub-dicts, each sub-dict containing configuration keys and values pertinent to a process or algorithm
Returns:configuration dict with some items converted to different objects
Return type:dict
Raises:KeyError – raise KeyError if configuration file is not specified correctly
yatsm.config_parser.expand_envvars(d)[source]

Recursively convert lookup that look like environment vars in a dict

This function things that environmental variables are values that begin with $ and are evaluated with os.path.expandvars(). No exception will be raised if an environment variable is not set.

Parameters:d – expand environment variables used in the values of this dictionary
Returns:input dictionary with environment variables expanded
Return type:dict
yatsm.config_parser.parse_config_file(config_file)[source]

Parse YAML config file

Parameters:config_file – path to YAML config file
Returns:
dict of sub-dicts, each sub-dict containing configuration keys
and values pertinent to a process or algorithm. Pickled estimators compatible with scikit-learn (i.e., that follow sklearn.base.BaseEstimator) models will be loaded and returned as an object within the dict
Return type:dict
Raises:KeyError – raise KeyError if configuration file is not specified correctly