pyrevs.core.config¶
A configuration class to expose limited configuration.
Attributes¶
Classes¶
A merge policy for configuration dataclasses. |
|
Lightweight structured access to configuration. |
Functions¶
|
Build a TOML-ready dict from config dataclasses. |
|
Merge two configuration dataclass objects. |
|
Print a help for a pyREVS config dataclass. |
Module Contents¶
- class Config(data: collections.abc.Mapping[str, Any])[source]¶
Lightweight structured access to configuration.
pyREVS input parameters are mostly handled through dataclasses to ensure default values are available and types are enforced: TOML file -> Config -> Typed dataclass.
The typed dataclass are the final object used to instanciate pyREVS objects (Sampler, Database, Trajectories, …)
The Config class provides a simple interface to access configuration parameters in a more structured way. To add a new section to the TOML input file, create a new dataclass with a __section__ class attribute set to the name of the section.