Skip to content

Commit f4db1d0

Browse files
committed
format(docstring)
1 parent dd21493 commit f4db1d0

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

climada/trajectories/impact_calc_strat.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,22 @@ def _apply_risk_transfer(
9191
def calculate_residual_or_risk_transfer_impact_matrix(
9292
self, imp_mat, attachement, cover, calc_residual
9393
):
94-
"""Calculate either the residual or the risk transfer impact matrix from a global risk transfer mechanism.
95-
96-
To compute the transfered risk, the function first computes for each event, the (positive) difference between their total impact and `attachment`. The transfered risk for each event is then defined as the minimum between this value and `cover`. The residual impact is the total impact minus the transfered risk.
97-
The impact matrix is then adjusted by multiply impact per centroids by the ratio between residual risk and total impact for each event. As such, the risk transfer is shared among all impacted exposure points and equaly distributed.
98-
99-
If `calc_residual` is False, the function returns the transfered risk at each points instead of the residual risk by using the ratio between transfered risk and total impact instead.
94+
"""Calculate either the residual or the risk transfer impact matrix
95+
from a global risk transfer mechanism.
96+
97+
To compute the transfered risk, the function first computes for each event,
98+
the (positive) difference between their total impact and `attachment`.
99+
The transfered risk for each event is then defined as the minimum between
100+
this value and `cover`. The residual impact is the total impact minus
101+
the transfered risk.
102+
The impact matrix is then adjusted by multiply impact per centroids
103+
by the ratio between residual risk and total impact for each event.
104+
As such, the risk transfer is shared among all impacted exposure points
105+
and equaly distributed.
106+
107+
If `calc_residual` is False, the function returns the transfered risk
108+
at each points instead of the residual risk by using the ratio between
109+
transfered risk and total impact instead.
100110
101111
Parameters
102112
----------
@@ -118,7 +128,10 @@ def calculate_residual_or_risk_transfer_impact_matrix(
118128
Warnings
119129
--------
120130
121-
This transfer capability is different and not exclusive with the one implemented in ImpactCalc, which is defined at the centroid level. The mechanism here corresponds to a global cover applied to the whole region studied.
131+
This transfer capability is different and not exclusive with the one
132+
implemented in ImpactCalc, which is defined at the centroid level.
133+
The mechanism here corresponds to a global cover applied to the whole
134+
region studied.
122135
123136
"""
124137
imp_mat = copy.deepcopy(imp_mat)

0 commit comments

Comments
 (0)