Configurable¶
- class scooch.Configurable(cfg)¶
A Base class for any object that has a given configuration, i.e., requires a certain set of parameters.
The configuration may include a heirarchy. That is, in the list of required fields may be a dictionary with each key corresponding to a name of a sublist of feilds and each key being a list corresponding to that sublist of field names.
Note that anything below the top level of the heirarchy will not be assigned as an attribute. It is assumed that values further down the heirarchy are for configuration of other objects and it is up to the derived class to use these values.
Constructor.
- Args:
cfg: dict - An object providing the configuration parameters for this object.
- property cfg¶
Getter function for a copy of this objects configuration.
- Return:
dict{str:value} : A hierarchical dictionary of this class’s configuration and all classes therein.
- classmethod populate_defaults(cfg)¶
Populates the defaults for this Configurable in the provided cfg, without actually constructing it.
- Args:
cfg: Config / Dict - A configuration for this configurable to be populated with defaults where missing config values exist.