Skip to content

AbstractVulnerabilityFunction

abstract_vulnerability_function

Classes

AbstractVulnerabilityFunction

Bases: ABC

Functions
calculate_vulnerability abstractmethod
calculate_vulnerability()

Calculate vulnerability percentages for buildings.

This is the main method that should be implemented by concrete classes. It should populate damage percentage fields in the buildings data.

Source code in packages/core/src/sphere/core/schemas/abstract_vulnerability_function.py
@abstractmethod
def calculate_vulnerability(self):
    """
    Calculate vulnerability percentages for buildings.

    This is the main method that should be implemented by concrete classes.
    It should populate damage percentage fields in the buildings data.
    """
    pass
apply_damage_percentages abstractmethod
apply_damage_percentages()

Apply damage percentages to buildings based on calculated vulnerability.

This method should be called after calculate_vulnerability() to populate the final damage percentage fields.

Source code in packages/core/src/sphere/core/schemas/abstract_vulnerability_function.py
@abstractmethod
def apply_damage_percentages(self):
    """
    Apply damage percentages to buildings based on calculated vulnerability.

    This method should be called after calculate_vulnerability() to
    populate the final damage percentage fields.
    """
    pass