2323
2424from pandas .tseries .offsets import BaseOffset
2525
26+ from climada .engine .impact import Impact
27+
2628__all__ = ["Measure" ]
2729
2830import copy
@@ -490,7 +492,30 @@ def apply(
490492 )
491493 return changed_exposures , changed_impfset , changed_hazard
492494
493- def calc_impact (self , exposures , impfset , hazard ):
495+ def calc_impact (
496+ self , exposures : Exposures , impfset : ImpactFuncSet , hazard : Hazard
497+ ) -> Impact :
498+ """Compute impact with the active measure.
499+
500+ This convenience method allow to compute an ``Impact`` object from an
501+ (Exposure, ImpactFuncSet, Hazard) triplet by first applying the measure
502+ to that triplet.
503+
504+ Parameters
505+ ----------
506+ exposures : Exposures
507+ The initial (no adaptation) exposures
508+ impfset : ImpactFuncSet
509+ The initial (no adaptation) impact function set
510+ hazard : Hazard
511+ The initial (no adaptation) hazard set
512+
513+ Returns
514+ -------
515+ Impact
516+ The computed impact when the measure is in effect.
517+
518+ """
494519 from climada .engine .impact_calc import (
495520 ImpactCalc , # pylint: disable=import-outside-toplevel
496521 )
@@ -507,4 +532,4 @@ def calc_impact(self, exposures, impfset, hazard):
507532 imp = ImpactCalc (new_exp , new_impfs , new_haz ).impact (
508533 save_mat = False , assign_centroids = False
509534 )
510- return imp .calc_risk_transfer (0 , 0 )
535+ return imp # .calc_risk_transfer(0, 0)
0 commit comments