@@ -111,7 +111,7 @@ def calc_freq_curve(self, return_per=None):
111111
112112 Returns
113113 -------
114- ImpactFreqCurve
114+ climada.engine.impact. ImpactFreqCurve
115115 """
116116 ifc = ImpactFreqCurve ()
117117 ifc .tag = self .tag
@@ -251,7 +251,7 @@ def calc_risk_transfer(self, attachment, cover):
251251
252252 Returns
253253 -------
254- climada.engine.Impact
254+ climada.engine.impact. Impact
255255 """
256256 new_imp = copy .deepcopy (self )
257257 if attachment or cover :
@@ -270,7 +270,7 @@ def calc_risk_transfer(self, attachment, cover):
270270
271271 return new_imp , Impact ()
272272
273- def plot_hexbin_eai_exposure (self , mask = None , ignore_zero = True ,
273+ def plot_hexbin_eai_exposure (self , mask = None , ignore_zero = False ,
274274 pop_name = True , buffer = 0.0 , extend = 'neither' ,
275275 axis = None , adapt_fontsize = True , ** kwargs ):
276276 """Plot hexbin expected annual impact of each exposure.
@@ -308,7 +308,7 @@ def plot_hexbin_eai_exposure(self, mask=None, ignore_zero=True,
308308 axis .set_title ('Expected annual impact' )
309309 return axis
310310
311- def plot_scatter_eai_exposure (self , mask = None , ignore_zero = True ,
311+ def plot_scatter_eai_exposure (self , mask = None , ignore_zero = False ,
312312 pop_name = True , buffer = 0.0 , extend = 'neither' ,
313313 axis = None , adapt_fontsize = True , ** kwargs ):
314314 """Plot scatter expected annual impact of each exposure.
@@ -331,8 +331,8 @@ def plot_scatter_eai_exposure(self, mask=None, ignore_zero=True,
331331 axis : matplotlib.axes._subplots.AxesSubplot, optional
332332 axis to use
333333 adapt_fontsize : bool, optional
334- If set to true, the size of the fonts will be adapted to the size of the figure. Otherwise
335- the default matplotlib font size is used. Default is True.
334+ If set to true, the size of the fonts will be adapted to the size of the figure.
335+ Otherwise the default matplotlib font size is used. Default is True.
336336 kwargs : optional
337337 arguments for hexbin matplotlib function
338338
@@ -371,8 +371,8 @@ def plot_raster_eai_exposure(self, res=None, raster_res=None, save_tiff=None,
371371 axis : matplotlib.axes._subplots.AxesSubplot, optional
372372 axis to use
373373 adapt_fontsize : bool, optional
374- If set to true, the size of the fonts will be adapted to the size of the figure. Otherwise
375- the default matplotlib font size is used. Default is True.
374+ If set to true, the size of the fonts will be adapted to the size of the figure.
375+ Otherwise the default matplotlib font size is used. Default is True.
376376 kwargs : optional
377377 arguments for imshow matplotlib function
378378
@@ -428,7 +428,7 @@ def plot_basemap_eai_exposure(self, mask=None, ignore_zero=False, pop_name=True,
428428 axis .set_title ('Expected annual impact' )
429429 return axis
430430
431- def plot_hexbin_impact_exposure (self , event_id = 1 , mask = None , ignore_zero = True ,
431+ def plot_hexbin_impact_exposure (self , event_id = 1 , mask = None , ignore_zero = False ,
432432 pop_name = True , buffer = 0.0 , extend = 'neither' ,
433433 axis = None , adapt_fontsize = True , ** kwargs ):
434434 """Plot hexbin impact of an event at each exposure.
@@ -457,8 +457,8 @@ def plot_hexbin_impact_exposure(self, event_id=1, mask=None, ignore_zero=True,
457457 axis : matplotlib.axes._subplots.AxesSubplot
458458 optional axis to use
459459 adapt_fontsize : bool, optional
460- If set to true, the size of the fonts will be adapted to the size of the figure. Otherwise
461- the default matplotlib font size is used. Default is True.
460+ If set to true, the size of the fonts will be adapted to the size of the figure.
461+ Otherwise the default matplotlib font size is used. Default is True.
462462
463463 Returns
464464 --------
@@ -471,12 +471,13 @@ def plot_hexbin_impact_exposure(self, event_id=1, mask=None, ignore_zero=True,
471471 kwargs ['cmap' ] = CMAP_IMPACT
472472 impact_at_events_exp = self ._build_exp_event (event_id )
473473 axis = impact_at_events_exp .plot_hexbin (mask , ignore_zero , pop_name ,
474- buffer , extend , axis = axis , adapt_fontsize = adapt_fontsize ,
474+ buffer , extend , axis = axis ,
475+ adapt_fontsize = adapt_fontsize ,
475476 ** kwargs )
476477
477478 return axis
478479
479- def plot_basemap_impact_exposure (self , event_id = 1 , mask = None , ignore_zero = True ,
480+ def plot_basemap_impact_exposure (self , event_id = 1 , mask = None , ignore_zero = False ,
480481 pop_name = True , buffer = 0.0 , extend = 'neither' , zoom = 10 ,
481482 url = 'http://tile.stamen.com/terrain/tileZ/tileX/tileY.png' ,
482483 axis = None , ** kwargs ):
@@ -619,7 +620,8 @@ def calc_impact_year_set(self, all_years=True, year_range=None):
619620
620621 Returns
621622 -------
622- Impact year set of type numpy.ndarray with summed impact per year.
623+ yearset : numpy.ndarray
624+ Impact year set of type numpy.ndarray with summed impact per year.
623625 """
624626 if year_range is None :
625627 year_range = []
@@ -851,16 +853,17 @@ def read_excel(self, *args, **kwargs):
851853 @staticmethod
852854 def video_direct_impact (exp , impf_set , haz_list , file_name = '' ,
853855 writer = animation .PillowWriter (bitrate = 500 ),
854- imp_thresh = 0 , args_exp = None , args_imp = None ):
856+ imp_thresh = 0 , args_exp = None , args_imp = None ,
857+ ignore_zero = False , pop_name = False ):
855858 """
856859 Computes and generates video of accumulated impact per input events
857860 over exposure.
858861
859862 Parameters
860863 ----------
861- exp : Exposures
864+ exp : climada.entity. Exposures
862865 exposures instance, constant during all video
863- impf_set : ImpactFuncSet
866+ impf_set : climada.entity. ImpactFuncSet
864867 impact functions
865868 haz_list : (list(Hazard))
866869 every Hazard contains an event; all hazards
@@ -877,6 +880,12 @@ def video_direct_impact(exp, impf_set, haz_list, file_name='',
877880 args_imp : optional
878881 arguments for scatter (points) or hexbin (raster)
879882 matplotlib function used in impact
883+ ignore_zero : bool, optional
884+ flag to indicate if zero and negative
885+ values are ignored in plot. Default: False
886+ pop_name : bool, optional
887+ add names of the populated places
888+ The default is False.
880889
881890 Returns
882891 -------
@@ -932,17 +941,17 @@ def run(i_time):
932941 haz_list [i_time ].plot_intensity (1 , axis = axis , cmap = 'Greys' , vmin = v_lim [0 ],
933942 vmax = v_lim [1 ], alpha = 0.8 )
934943 if plot_raster :
935- exp .plot_hexbin (axis = axis , mask = exp_list [i_time ], ignore_zero = True ,
936- pop_name = False , ** args_exp )
944+ exp .plot_hexbin (axis = axis , mask = exp_list [i_time ], ignore_zero = ignore_zero ,
945+ pop_name = pop_name , ** args_exp )
937946 if imp_list [i_time ].coord_exp .size :
938- imp_list [i_time ].plot_hexbin_eai_exposure (axis = axis , pop_name = False ,
947+ imp_list [i_time ].plot_hexbin_eai_exposure (axis = axis , pop_name = pop_name ,
939948 ** args_imp )
940949 fig .delaxes (fig .axes [1 ])
941950 else :
942- exp .plot_scatter (axis = axis , mask = exp_list [i_time ], ignore_zero = True ,
943- pop_name = False , ** args_exp )
951+ exp .plot_scatter (axis = axis , mask = exp_list [i_time ], ignore_zero = ignore_zero ,
952+ pop_name = pop_name , ** args_exp )
944953 if imp_list [i_time ].coord_exp .size :
945- imp_list [i_time ].plot_scatter_eai_exposure (axis = axis , pop_name = False ,
954+ imp_list [i_time ].plot_scatter_eai_exposure (axis = axis , pop_name = pop_name ,
946955 ** args_imp )
947956 fig .delaxes (fig .axes [1 ])
948957 fig .delaxes (fig .axes [1 ])
@@ -1155,7 +1164,7 @@ def select(self,
11551164
11561165 Returns
11571166 -------
1158- imp : climada.engine.Impact
1167+ imp : climada.engine.impact. Impact
11591168 A new impact object with a selection of events and/or exposures
11601169
11611170 """
0 commit comments