@@ -92,6 +92,9 @@ def impact(
9292 Default: True
9393 assign_centroids : bool, optional
9494 indicates whether centroids are assigned to the self.exposures object.
95+ Recommendation: assign the centroids directly with control
96+ over the distance metric and the distance threshold using
97+ `exposure.assign_centroids(hazard)`. In this case, set assign_centroids to ``False``.
9598 Centroids assignment is an expensive operation; set this to ``False`` to save
9699 computation time if the hazards' centroids are already assigned to the exposures
97100 object.
@@ -114,10 +117,19 @@ def impact(
114117 >>> imp = impcalc.impact(insured=True)
115118 >>> imp.aai_agg
116119
120+ >>> haz = Hazard.from_hdf5(HAZ_DEMO_H5) # Set hazard
121+ >>> impfset = ImpactFuncSet.from_excel(ENT_TEMPLATE_XLS)
122+ >>> exp = Exposures(pd.read_excel(ENT_TEMPLATE_XLS))
123+ >>> exp.assign_centroids(hazard, threshold=1.5, distance='haversine')
124+ >>> impcalc = ImpactCal(exp, impfset, haz)
125+ >>> imp = impcalc.impact(insured=True, assign_centroids=False)
126+ >>> imp.aai_agg
127+
117128 See also
118129 --------
119130 apply_deductible_to_mat : apply deductible to impact matrix
120131 apply_cover_to_mat : apply cover to impact matrix
132+ climada.exposures.assign_centroids : assign centroids to exposures explicitly
121133 """
122134 # TODO: consider refactoring, making use of Exposures.hazard_impf
123135 # check for compatibility of exposures and hazard type
0 commit comments