RuntimeBase¶
- class tolteca.utils.RuntimeBase(config)[source]¶
Bases:
object
A base class that consumes
RuntimeContext
.This class acts as a proxy of an underlying
RuntimeContext
object, 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_cls
constructed 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
config
as YAML tooutput
yaml_load
(stream)Attributes Documentation
- config¶
The config object of
config_cls
constructed 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
config
as 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)¶