tud_lbm.config.adapter_base
Base class for configuration file adapters.
Classes
Converts a config file into a SimulationConfig and back. |
Functions
|
Return the appropriate adapter for path based on file extension. |
Module Contents
- class tud_lbm.config.adapter_base.ConfigAdapter[source]
Bases:
abc.ABCConverts a config file into a SimulationConfig and back.
- abstractmethod load_raw(path: str) dict[str, Any][source]
Parse path and return raw configuration dict.
Unlike
load(), this returns the raw config dict without instantiatingSimulationConfig. Useful for detecting array fields before expansion.- Parameters:
path – Filesystem path to a configuration file.
- Returns:
Raw config dictionary.
- abstractmethod load(path: str) tud_lbm.config.simulation_config.SimulationConfig[source]
Parse path and return a
SimulationConfig.- Parameters:
path – Filesystem path to a configuration file.
- Returns:
A validated
SimulationConfig.
- abstractmethod save(config: tud_lbm.config.simulation_config.SimulationConfig, path: str) None[source]
Save a
SimulationConfigto path.- Parameters:
config – Configuration to save.
path – Filesystem path where to save the configuration.
- classmethod build_sections(config: tud_lbm.config.simulation_config.SimulationConfig) dict[str, Any][source]
Build a format-agnostic nested dict from config, routed by CONFIG_SECTION metadata.
- tud_lbm.config.adapter_base.get_adapter(path: str) ConfigAdapter[source]
Return the appropriate adapter for path based on file extension.