pandemia.config¶
Module supporting configuration of the simulation.
A configuration is set in a single YAML file, and used by the simulator and simulator components.
Module Contents¶
Classes¶
Represents a simulation configuration. |
- class pandemia.config.Config(filename: Optional[str] = None, _dict: Optional[dict] = None, dirname: Optional[str] = None)¶
Represents a simulation configuration.
This class behaves like a dict, but is read-only
- INT_INDEX_FORMAT¶
- subconfig(key: str) Config¶
Create a Config object from a key in this config object, with the same directory settings.
- filepath(key: str, path: Optional[str] = None, *, ensure_exists: bool = False)¶
Return the value at ‘key’ but as a filepath. Filepaths in config are relative to the basedir, unless they are specified as absolute (e.g. they have a leading slash or drive letter
- static load_config(filename: str) dict¶
Load a YAML config file and return the dict.