8.1.2. pelicun.auto
Classes and methods that auto-populate DL models.
Functions
|
Auto populate the DL configuration with predefined rules. |
- pelicun.auto.auto_populate(config: dict, auto_script_path: Path, **kwargs) tuple[dict, pd.DataFrame] [source]
Auto populate the DL configuration with predefined rules.
Automatically populates the Damage and Loss (DL) configuration for a Pelicun calculation using predefined rules. This function modifies the provided configuration dictionary based on an external Python script that defines auto-population rules. It supports using built-in scripts or custom scripts specified by the user.
- Parameters:
- config: dict
A configuration dictionary with a ‘GeneralInformation’ key that holds another dictionary with attributes of the asset of interest. This dictionary is modified in-place with auto-populated values.
- auto_script_path: str
The path pointing to a Python script with the auto-population rules. Built-in scripts can be referenced using the ‘PelicunDefault/XY’ format where ‘XY’ is the name of the script.
- kwargs
Keyword arguments.
- Returns:
- tuple
A tuple containing two items: 1. Updated configuration dictionary including new ‘DL’ key with damage and loss information. 2. A dictionary of component quantities (CMP) derived from the auto-population process.
- Raises:
- ValueError
If the configuration dictionary does not contain necessary asset information under ‘GeneralInformation’.