Skip to content

Commit

Permalink
Debug improvements
Browse files Browse the repository at this point in the history
Improved execution of scripts for case where country being profiled not listed in data.
  • Loading branch information
shanewhi authored Jan 30, 2025
1 parent 94a6a71 commit b0e2535
Show file tree
Hide file tree
Showing 5 changed files with 1,222 additions and 1,212 deletions.
4 changes: 2 additions & 2 deletions chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -2702,7 +2702,7 @@ def treemap_1_subplot(
fig.suptitle(
country,
x=0.125,
y=0.96,
y=0.955,
horizontalalignment="left",
fontsize=user_globals.Constant.SUPTITLE_FONT_SIZE.value,
fontweight=user_globals.Constant.SUPTITLE_FONT_WEIGHT.value,
Expand All @@ -2726,7 +2726,7 @@ def treemap_1_subplot(
)
fig.text(
0.125,
0.025,
0.115,
footer_text,
horizontalalignment="left",
verticalalignment='top',
Expand Down
3 changes: 2 additions & 1 deletion collate.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ def populate_energy_system(country, ei_data):
else:
print("Country not in EI data.\n")
incl_ei_flag = False
ffco2 = None
ffprod_PJ = None
primary_PJ = None
elecprod_TWh = None
Expand Down Expand Up @@ -635,7 +636,7 @@ def populate_energy_system(country, ei_data):
if not consumption_PJ.at[year, "Total"]:
consumption_PJ.at[year, "Total"] = 0

if incl_iea_flag == False:
if incl_iea_flag is False:
print("Country not in IEA data.\n")
consumption_PJ = None
else:
Expand Down
6 changes: 6 additions & 0 deletions countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def iea_country_name(country_in):
return "'KOREA'"
if country == "'TOTAL EU'":
return "'EU28'"
if country == "'SOUTH AFRICA'":
return "'SOUTHAFRIC'"
if country == "'SOUTH KOREA'":
return "'KOREA'"
if country == "'TURKIYE'":
return "'TURKEY'"
else:
return country

Expand Down
Loading

0 comments on commit b0e2535

Please sign in to comment.