Skip to content

Commit d658bbc

Browse files
rerun hazard tutorial
1 parent eb49fe3 commit d658bbc

File tree

3 files changed

+24
-53
lines changed

3 files changed

+24
-53
lines changed

climada/engine/impact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ def plot_basemap_impact_exposure(self, event_id=1, mask=None, ignore_zero=False,
906906
def plot_rp_imp(self, return_periods=(25, 50, 100, 250),
907907
log10_scale=True, smooth=True, axis=None, **kwargs):
908908
"""
909-
This function is deprecated, use Impact.local_exceedance_impact and
909+
This function is deprecated, use Impact.local_exceedance_impact and
910910
util.plot.plot_from_gdf instead.
911911
"""
912912
LOGGER.warning("The use of Impact.plot_rp_imp is deprecated."

climada/util/interpolation.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ def interpolate_ev(
8686
if x_train.size < 2:
8787
if not extrapolation:
8888
return np.full_like(x_test, np.nan)
89-
else:
90-
LOGGER.warning('Data is being extrapolated.')
91-
return _interpolate_small_input(x_test, x_train, y_train, logy, y_asymptotic)
89+
LOGGER.warning('Data is being extrapolated.')
90+
return _interpolate_small_input(x_test, x_train, y_train, logy, y_asymptotic)
9291

9392
# warn if values are being extrapolated
9493
if extrapolation and (np.min(x_test) < np.min(x_train) or np.max(x_test) > np.max(x_train)):
@@ -100,7 +99,7 @@ def interpolate_ev(
10099
elif extrapolation == 'extrapolate_constant':
101100
if not all(sorted(x_train) == x_train):
102101
raise ValueError('x_train array must be sorted in ascending order.')
103-
fill_value = (y_train[0], np.log10(y_asymptotic) if logy else y_asymptotic)
102+
fill_value = (y_train[0], np.log10(y_asymptotic) if logy else y_asymptotic)
104103
else:
105104
fill_value = np.nan
106105

@@ -151,13 +150,11 @@ def stepfunction_ev(
151150
x_test, x_train, y_train, None, None, x_threshold, y_threshold
152151
)
153152

154-
155-
156153
# handle case of small training data sizes
157154
if x_train.size < 2:
158155
LOGGER.warning('Data is being extrapolated.')
159156
return _interpolate_small_input(x_test, x_train, y_train, None, y_asymptotic)
160-
157+
161158
# warn if values are being extrapolated
162159
if (np.min(x_test) < np.min(x_train) or np.max(x_test) > np.max(x_train)):
163160
LOGGER.warning('Data is being extrapolated.')

doc/tutorial/climada_hazard_Hazard.ipynb

Lines changed: 19 additions & 45 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)