Skip to content

Commit 677fba9

Browse files
committed
Remove plot_impf_set function and improve exception type
1 parent 042e6c9 commit 677fba9

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

climada/util/calibrate/base.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ def __post_init__(self, assign_centroids):
8989
"""Prepare input data"""
9090
if not isinstance(self.data, pd.DataFrame):
9191
if isinstance(self.data, pd.Series):
92-
raise ValueError(
92+
raise TypeError(
9393
"You passed a pandas Series as 'data'. Please transform it into a "
9494
"dataframe with Series.to_frame() and make sure that columns "
9595
"correctly indicate locations and indexes events."
9696
)
97-
raise ValueError("'data' must be a pandas.DataFrame")
97+
raise TypeError("'data' must be a pandas.DataFrame")
9898

9999
if assign_centroids:
100100
self.exposure.assign_centroids(self.hazard)
@@ -201,22 +201,6 @@ def __post_init__(self):
201201
).impact(assign_centroids=True, save_mat=True)
202202
self._impact_label = f"Impact [{self.input.exposure.value_unit}]"
203203

204-
def plot_impf_set(self, **plot_kwargs):
205-
"""Plot the optimized impact functions
206-
207-
This calls the plot function of the respective impact function set.
208-
209-
Parameters
210-
----------
211-
plot_kwargs
212-
Plotting keyword arguments passed to the underlying plotting method.
213-
214-
See Also
215-
--------
216-
:py:meth:`~climada.entity.impact_funcs.impact_func_set.ImpactFuncSet.plot`
217-
"""
218-
return self.impf_set.plot(**plot_kwargs)
219-
220204
def plot_impf_variability(
221205
self,
222206
cost_func_diff: float = 0.1,

doc/tutorial/climada_util_calibrate.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,7 @@
26222622
"from climada.util.calibrate import OutputEvaluator\n",
26232623
"\n",
26242624
"output_eval = OutputEvaluator(input, bayes_output)\n",
2625-
"output_eval.plot_impf_set()\n"
2625+
"output_eval.impf_set.plot()\n"
26262626
]
26272627
},
26282628
{
@@ -3381,7 +3381,7 @@
33813381
"\n",
33823382
" # Evaluate output\n",
33833383
" output_eval = OutputEvaluator(input, bayes_output)\n",
3384-
" output_eval.plot_impf_set()\n",
3384+
" output_eval.impf_set.plot()\n",
33853385
"\n",
33863386
" plt.figure() # New figure because seaborn.heatmap draws into active axes\n",
33873387
" output_eval.plot_event_region_heatmap(\n",

0 commit comments

Comments
 (0)