peal.global_utils.get_config_model

peal.global_utils.get_config_model(config_data)[source]

Find the pydantic config class that a raw config dict describes.

Two conventions are supported. If the dict has a config_name key, that name is looked up among all BaseModel subclasses found under peal. Otherwise the class name is built as <category>_type + "Config" (for example category: explainer and explainer_type: SCE give SCEConfig), and the search is narrowed to the subclasses of the *Config base class defined in peal/<category>s/interfaces.py.

Parameters:

config_data (dict) – The raw yaml content.

Returns:

The config class.

Return type:

type

Raises:

KeyError – If no class of the derived name exists.