RuntimeBase¶
- class tolteca.utils.RuntimeBase(config)[source]¶
Bases:
objectA base class that consumes
RuntimeContext.This class acts as a proxy of an underlying
RuntimeContextobject, providing a unified interface for subclasses to managed specialized config objects constructed from the config dict of the runtime context and its the runtime info.- Parameters
- config
RuntimeContext,pathlib.Path, str, dict The runtime context object, or the config source of it.
- config
Attributes Summary
The config object of
config_clsconstructed from the runtime context config dict.Subclasses implement this to provide specialized config object.
Methods Summary
update(config[, mode])Update the config object with provided config dict.
yaml_dump(config[, output])Dump
configas YAML tooutputyaml_load(stream)Attributes Documentation
- config¶
The config object of
config_clsconstructed from the runtime context config dict.The config dict is validated and the constructed object is cached. The config object can be updated by using
RuntimeBase.update().
- config_cls = NotImplemented¶
Subclasses implement this to provide specialized config object.
- rc¶
Methods Documentation
- classmethod yaml_dump(config, output=None)¶
Dump
configas YAML tooutput- Parameters
- configdict
The config to write.
- outputio.StringIO, optional
The object to write to. If None, return the YAML as string.
- classmethod yaml_load(stream)¶