physrisk.vulnerability_models
Submodules
physrisk.vulnerability_models.chronic_heat_models
- class physrisk.vulnerability_models.chronic_heat_models.ChronicHeatGZNModel(indicator_id: str = 'mean_degree_days/above/32c', delta=True)
Bases:
VulnerabilityModelBaseModel which estiamtes the labour productivity impact based on chronic heat based on the paper “Neidell M, Graff Zivin J, Sheahan M, Willwerth J, Fant C, Sarofim M, et al. (2021) Temperature and work: Time allocated to work under varying climate and labor market conditions.” Average annual work hours are based on USA values reported by the OECD for 2021.
- get_data_requests(asset: Asset, *, scenario: str, year: int) HazardDataRequest | Sequence[HazardDataRequest]
Request the hazard data needed by the vulnerability model for a specific asset (this is a Google-style doc string)
- Parameters:
asset – Asset for which data is requested.
scenario – Climate scenario of calculation.
year – Projection year of calculation.
- Returns:
Single data requests.
- get_impact(asset: Asset, data_responses: Sequence[HazardDataResponse]) ImpactDistrib
Calcaulate impact (disruption) of asset based on the hazard data returned.
- Parameters:
asset – Asset for which impact is calculated.
data_responses – responses to the hazard data requests generated in get_data_requests.
- Returns:
Probability distribution of impacts.
- class physrisk.vulnerability_models.chronic_heat_models.ChronicHeatWBGTGZNModel(indicator_id: str = 'mean_work_loss_high')
Bases:
ChronicHeatGZNModelImplementation of the WBGT/GZN chronic heat model. This model inherits attributes from the ChronicHeatGZN model and estimates the results based on applying both GZN and WBGT.
- work_type_mapping()
- get_data_requests(asset: Asset, *, scenario: str, year: int) HazardDataRequest | Sequence[HazardDataRequest]
Request the hazard data needed by the vulnerability model for a specific asset (this is a Google-style doc string)
- Parameters:
asset – Asset for which data is requested.
scenario – Climate scenario of calculation.
year – Projection year of calculation.
- Returns:
Single or multiple data requests.
- get_impact(asset: Asset, data_responses: Sequence[HazardDataResponse]) ImpactDistrib
Function to return the impact distribution of the wbgt model.
- physrisk.vulnerability_models.chronic_heat_models.two_variable_joint_variance(ex, varx, ey, vary)
Function to estimate the variance of two uncorrelated variables.
- physrisk.vulnerability_models.chronic_heat_models.get_impact_distrib(fraction_loss_mean: float, fraction_loss_std: float, hazard_type: type, hazard_paths: List[str], impact_type: ImpactType, hazard_indicator_id: str) ImpactDistrib
Calculate impact (disruption) of asset based on the hazard data returned.
- Parameters:
fraction_loss_mean – mean of the impact distribution
fraction_loss_std – standard deviation of the impact distribution
hazard_type – Hazard Type.get_impact_distrib
impact_type – Impact Type.
hazard_paths – path to the hazard indicator data source.
- Returns:
Probability distribution of impacts.
physrisk.vulnerability_models.example_models
- class physrisk.vulnerability_models.example_models.ExampleCdfBasedVulnerabilityModel(*, indicator_id: str, hazard_type: type)
Bases:
VulnerabilityModel- get_impact_curve(intensities, asset)
Define a VulnMatrixProvider.
The VulnMatrixProvider returns probabilities of specified impact bins for the intensity bin centres.
- class physrisk.vulnerability_models.example_models.PlaceholderVulnerabilityModel(indicator_id: str, hazard_type: type, impact_type: ImpactType)
Bases:
VulnerabilityModelBasePlaceholder vulnerability models are for when an impact or hazard indicator value is only intended to be used in a score-based risk measure.
- get_data_requests(asset: Asset, *, scenario: str, year: int)
Provide the hazard event data requests.
It will return one or more HazardDataRequest as required to calculate the VulnerabilityDistrib and HazardEventDistrib for the asset.
- get_impact(asset: Asset, data_responses: Sequence[HazardDataResponse]) ImpactDistrib
- class physrisk.vulnerability_models.example_models.PlaceholderFireModel
Bases:
PlaceholderVulnerabilityModel- get_impact(asset: Asset, data_responses: Sequence[HazardDataResponse]) ImpactDistrib
physrisk.vulnerability_models.labour_models
physrisk.vulnerability_models.power_generating_asset_models
- class physrisk.vulnerability_models.power_generating_asset_models.InundationModel(indicator_id='flood_depth')
Bases:
VulnerabilityModelAcuteBase- get_data_requests(asset: Asset, *, scenario: str, year: int) HazardDataRequest | Sequence[HazardDataRequest]
Provide the list of hazard event data requests required in order to calculate the VulnerabilityDistrib and HazardEventDistrib for the asset.
- get_distributions(asset: Asset, event_data_responses: Sequence[HazardDataResponse])
Return distributions for asset, based on hazard event date: VulnerabilityDistrib and HazardEventDistrib.
- class physrisk.vulnerability_models.power_generating_asset_models.TemperatureModel
- class physrisk.vulnerability_models.power_generating_asset_models.SimpleDroughtModel
physrisk.vulnerability_models.real_estate_models
Define vulnerability models for assessing the impact of various hazards on real estate assets.
- class physrisk.vulnerability_models.real_estate_models.RealEstateInundationModel(*, hazard_type: type, indicator_id: str, resource: str = 'EU JRC global flood depth-damage functions', impact_bin_edges=array([0., 0.01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.]))
Bases:
VulnerabilityModelInundation vulnerability model for real estates assets.
- get_impact_curve(intensity_bin_centres: ndarray, asset: Asset) VulnMatrixProvider
Build vulnerability distributions for flood intensities for a given asset.
Args:
- intensity_bin_centres: One-dimensional array of hazard intensity bin
centres. Each value represents the midpoint of a discrete hazard intensity interval and is used to match intensity levels to the corresponding impacts from the vulnerability curve.
- asset: Asset for which the vulnerability curve is required. When
assetis aRealEstateAsset, itslocationandtypeare used to select the appropriate curve. For a genericAsset, the fallback curve("Europe", "Buildings/Residential")is used.
Returns:
- VulnMatrixProvider: Provider containing one beta distribution-derived
impact CDF per intensity bin centre, constructed from interpolated impact means and standard deviations from the selected vulnerability curve, which defines the relationship between hazard intensity and impact.
- closest_curve_of_type(curve: VulnerabilityCurve, asset_type: str) VulnerabilityCurve
Find a proxy curve of the same asset type that includes standard deviations.
Args:
- curve: Vulnerability curve whose mean impact profile is used as the
reference when searching for the closest proxy.
- asset_type: Asset type of the asset under evaluation. It is used to
restrict the search to compatible vulnerability curves, for example
"Buildings/Residential", so the selected proxy curve best matches that asset class.
Returns:
- VulnerabilityCurve: The candidate curve of the requested asset type
with non-empty
impact_stdvalues and the smallest sum of squared differences fromcurveacross the reference intensity grid.
- sum_square_diff(curve1: VulnerabilityCurve, curve2: VulnerabilityCurve) float
Compute a distance metric between two vulnerability curves.
Args:
- curve1: Reference vulnerability curve. Its intensity grid is used as
the comparison domain.
- curve2: Curve to compare against
curve1. Its mean impacts are interpolated onto the intensity values from
curve1before the difference is calculated.
Returns:
- float: Sum of squared differences between
curve1.impact_meanand the interpolated
curve2.impact_meanvalues. Smaller values indicate more similar curves.
- class physrisk.vulnerability_models.real_estate_models.RealEstateCoastalInundationModel(*, indicator_id: str = 'flood_depth', resource: str = 'EU JRC global flood depth-damage functions', impact_bin_edges=array([0., 0.01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.]))
Bases:
RealEstateInundationModelVulnerability model for assessing the impact of coastal inundation on real estate assets.
- class physrisk.vulnerability_models.real_estate_models.RealEstatePluvialInundationModel(*, indicator_id: str = 'flood_depth', resource: str = 'EU JRC global flood depth-damage functions', impact_bin_edges=array([0., 0.01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.]))
Bases:
RealEstateInundationModelPluvial inundation vulnerability model for real estate assets.
- class physrisk.vulnerability_models.real_estate_models.RealEstateRiverineInundationModel(*, indicator_id: str = 'flood_depth', resource: str = 'EU JRC global flood depth-damage functions', impact_bin_edges=array([0., 0.01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.]))
Bases:
RealEstateInundationModelRiverine inundation vulnerability model for real estate assets.
- class physrisk.vulnerability_models.real_estate_models.GenericTropicalCycloneModel
Bases:
DeterministicVulnerabilityModelSimple generic tropical cyclone vulnerability model for real estate assets.
- wind_damage(v: ndarray, v_half: float)
Calculate damage based on functional form of Emanuel K. Global warming effects on US hurricane damage.
Weather, Climate, and Society. 2011 Oct 1;3(4):261-8. Using a threshold speed of 25.7 m/s. A review of the origin of parameters is available in Eberenz S, Lüthi S, Bresch DN. Regional tropical cyclone impact functions for globally consistent risk assessments. Natural Hazards and Earth System Sciences. 2021 Jan 29;21(1):393-415. which also provides suggested region-specific variations.
Args:
v (np.ndarray[float]): Wind speeds at which to calculate the fractional damage. v_half (float): The ‘v_half’ function parameter.
Returns:
np.ndarray[float]: Fractional damage.
- class physrisk.vulnerability_models.real_estate_models.CoolingModel(threshold_temp_c: float = 23)
Bases:
VulnerabilityModelBaseSimple degree-days-based vulnerability model for real estate assets.
- get_data_requests(asset: Asset, *, scenario: str, year: int) HazardDataRequest
Build the hazard data request needed to estimate cooling demand.
Args:
- asset: Asset whose location and optional geometry define where hazard
parameter data should be requested.
scenario: Climate scenario identifier forwarded to the hazard model. year: Projection year for which the hazard parameter data is required.
Returns:
- HazardDataRequest: Single request for chronic heat parameter data at
the asset coordinates, using this model’s indicator identifier and the asset geometry when available.
- get_impact(asset: Asset, data_responses: Sequence[HazardDataResponse]) ImpactDistrib