configClass#
- lsst.ts.wep.utils.configClass(config, classObj)#
Configure the class.
This function is a generic wrapper around the process of passing a config to the __init__ function of a class, so that the passed config can take on a variety of types.
If config is a string, it is assumed to be the path to a config file, and this path is passed to the configFile argument of the class constructor. If config is a dictionary, then the contents are passed as keyword arguments. If config is an instance of the class, the instance is returned unchanged. If config is None, then the class is instantiated using its defaults.
- Parameters:
- Returns:
An instance of the classObj class with the provided configuration
- Return type:
class instance
- Raises:
TypeError – If classObj is not a class