Skip to content

Commit e74f5e4

Browse files
committed
correct pylint: static code analysis
1 parent fafb76f commit e74f5e4

File tree

1 file changed

+24
-26
lines changed

1 file changed

+24
-26
lines changed

climada/engine/impact.py

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def calc(self, exposures, impact_funcs, hazard, save_mat=False):
178178
if if_haz not in exposures and INDICATOR_IF not in exposures:
179179
LOGGER.error('Missing exposures impact functions %s.', INDICATOR_IF)
180180
raise ValueError
181-
elif if_haz not in exposures:
181+
if if_haz not in exposures:
182182
LOGGER.info('Missing exposures impact functions for hazard %s. ' +\
183183
'Using impact functions in %s.', if_haz, INDICATOR_IF)
184184
if_haz = INDICATOR_IF
@@ -221,7 +221,7 @@ def calc(self, exposures, impact_funcs, hazard, save_mat=False):
221221

222222
def plot_hexbin_eai_exposure(self, mask=None, ignore_zero=True,
223223
pop_name=True, buffer=0.0, extend='neither',
224-
var_name=None, **kwargs):
224+
**kwargs):
225225
"""Plot hexbin expected annual impact of each exposure.
226226
227227
Parameters:
@@ -233,21 +233,20 @@ def plot_hexbin_eai_exposure(self, mask=None, ignore_zero=True,
233233
Default: 1.0.
234234
extend (str, optional): extend border colorbar with arrows.
235235
[ 'neither' | 'both' | 'min' | 'max' ]
236-
var_name (str, optional): Colorbar label
237236
kwargs (optional): arguments for hexbin matplotlib function
238237
239238
Returns:
240239
matplotlib.figure.Figure, cartopy.mpl.geoaxes.GeoAxesSubplot
241240
"""
242241
eai_exp = self._build_exp()
243-
fig, ax = eai_exp.plot_hexbin(mask, ignore_zero, pop_name, buffer,
244-
extend, **kwargs)
245-
ax[0, 0].set_title('Expected annual impact')
246-
return fig, ax
242+
fig, axes = eai_exp.plot_hexbin(mask, ignore_zero, pop_name, buffer,
243+
extend, **kwargs)
244+
axes[0, 0].set_title('Expected annual impact')
245+
return fig, axes
247246

248247
def plot_scatter_eai_exposure(self, mask=None, ignore_zero=True,
249248
pop_name=True, buffer=0.0, extend='neither',
250-
var_name=None, **kwargs):
249+
**kwargs):
251250
"""Plot scatter expected annual impact of each exposure.
252251
253252
Parameters:
@@ -259,21 +258,20 @@ def plot_scatter_eai_exposure(self, mask=None, ignore_zero=True,
259258
Default: 1.0.
260259
extend (str, optional): extend border colorbar with arrows.
261260
[ 'neither' | 'both' | 'min' | 'max' ]
262-
var_name (str, optional): Colorbar label
263261
kwargs (optional): arguments for hexbin matplotlib function
264262
265263
Returns:
266264
matplotlib.figure.Figure, cartopy.mpl.geoaxes.GeoAxesSubplot
267265
"""
268266
eai_exp = self._build_exp()
269-
fig, ax = eai_exp.plot_scatter(mask, ignore_zero, pop_name, buffer,
270-
extend, **kwargs)
271-
ax[0, 0].set_title('Expected annual impact')
272-
return fig, ax
267+
fig, axes = eai_exp.plot_scatter(mask, ignore_zero, pop_name, buffer,
268+
extend, **kwargs)
269+
axes[0, 0].set_title('Expected annual impact')
270+
return fig, axes
273271

274272
def plot_raster_eai_exposure(self, res=None, raster_res=None, save_tiff=None,
275-
raster_f=lambda x: np.log10((np.fmax(x+1, 1))),
276-
label='value (log10)', **kwargs):
273+
raster_f=lambda x: np.log10((np.fmax(x+1, 1))),
274+
label='value (log10)', **kwargs):
277275
"""Plot raster expected annual impact of each exposure.
278276
279277
Parameters:
@@ -291,15 +289,15 @@ def plot_raster_eai_exposure(self, res=None, raster_res=None, save_tiff=None,
291289
matplotlib.figure.Figure, cartopy.mpl.geoaxes.GeoAxesSubplot
292290
"""
293291
eai_exp = self._build_exp()
294-
fig, ax = eai_exp.plot_raster(res, raster_res, save_tiff, raster_f,
295-
label, **kwargs)
296-
ax[0, 0].set_title('Expected annual impact')
297-
return fig, ax
292+
fig, axes = eai_exp.plot_raster(res, raster_res, save_tiff, raster_f,
293+
label, **kwargs)
294+
axes[0, 0].set_title('Expected annual impact')
295+
return fig, axes
298296

299297
def plot_basemap_eai_exposure(self, mask=None, ignore_zero=False, pop_name=True,
300-
buffer=0.0, extend='neither', zoom=10,
301-
url='http://tile.stamen.com/terrain/tileZ/tileX/tileY.png',
302-
**kwargs):
298+
buffer=0.0, extend='neither', zoom=10,
299+
url='http://tile.stamen.com/terrain/tileZ/tileX/tileY.png',
300+
**kwargs):
303301
"""Plot basemap expected annual impact of each exposure.
304302
305303
Parameters:
@@ -319,10 +317,10 @@ def plot_basemap_eai_exposure(self, mask=None, ignore_zero=False, pop_name=True,
319317
matplotlib.figure.Figure, cartopy.mpl.geoaxes.GeoAxesSubplot
320318
"""
321319
eai_exp = self._build_exp()
322-
fig, ax = eai_exp.plot_basemap(mask, ignore_zero, pop_name, buffer,
323-
extend, zoom, url, **kwargs)
324-
ax[0, 0].set_title('Expected annual impact')
325-
return fig, ax
320+
fig, axes = eai_exp.plot_basemap(mask, ignore_zero, pop_name, buffer,
321+
extend, zoom, url, **kwargs)
322+
axes[0, 0].set_title('Expected annual impact')
323+
return fig, axes
326324

327325
def write_csv(self, file_name):
328326
""" Write data into csv file. imp_mat is not saved.

0 commit comments

Comments
 (0)