Skip to content

Commit

Permalink
add assertion statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Aug 8, 2024
1 parent 02f1246 commit b5c2a05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ogcore/output_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def plot_aggregates(
assert reform_tpi is not None
fig1, ax1 = plt.subplots()
for i, v in enumerate(var_list):
assert v in VAR_LABELS.keys() #TODO provide warning message here
assert v in VAR_LABELS.keys(), "{} is not in the list of variable labels".format(v)
if plot_type == "pct_diff":
if v in ["r_gov", "r", "r_p"]:
# Compute just percentage point changes for rates
Expand Down Expand Up @@ -238,7 +238,7 @@ def plot_industry_aggregates(
assert reform_tpi is not None
fig1, ax1 = plt.subplots()
for i, v in enumerate(var_list):
assert v in VAR_LABELS.keys() #TODO provide warning message here
assert v in VAR_LABELS.keys(), "{} is not in the list of variable labels".format(v)
if len(var_list) == 1:
var_label = ""
else:
Expand Down Expand Up @@ -451,7 +451,7 @@ def plot_gdp_ratio(
start_index = start_year - base_params.start_year
fig1, ax1 = plt.subplots()
for i, v in enumerate(var_list):
assert v in ToGDP_LABELS.keys() #TODO provide warning message here
assert v in ToGDP_LABELS.keys(), "{} is not in the list of variable labels".format(v)
if plot_type == "levels":
plot_var_base = (
base_tpi[v][: base_params.T] / base_tpi["Y"][: base_params.T]
Expand Down

0 comments on commit b5c2a05

Please sign in to comment.