Skip to content

Commit

Permalink
Merge pull request #617 from NREL/develop
Browse files Browse the repository at this point in the history
Fix /summary -> Saved Evals for off-grid runs
  • Loading branch information
Bill-Becker authored Nov 15, 2024
2 parents 4b08836 + 051c088 commit 05bed60
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion reoptjl/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,8 @@ def queryset_for_summary(api_metas,summary_dict:dict):
)
if len(utility) > 0:
for m in utility:
summary_dict[str(m.meta.run_uuid)]['focus'] = ''
if 'focus' not in summary_dict[str(m.meta.run_uuid)].keys():
summary_dict[str(m.meta.run_uuid)]['focus'] = ''
if m.outage_start_time_step is None:
if len(m.outage_start_time_steps) == 0:
summary_dict[str(m.meta.run_uuid)]['focus'] += "Financial,"
Expand Down Expand Up @@ -1097,6 +1098,9 @@ def queryset_for_summary(api_metas,summary_dict:dict):
)
if len(site_inputs) > 0:
for m in site_inputs:
# if focus key doesnt exist, create it
if 'focus' not in summary_dict[str(m.meta.run_uuid)].keys():
summary_dict[str(m.meta.run_uuid)]['focus'] = ''
try: # can be NoneType
if m.renewable_electricity_min_fraction > 0:
summary_dict[str(m.meta.run_uuid)]['focus'] += "Clean-energy,"
Expand All @@ -1118,6 +1122,9 @@ def queryset_for_summary(api_metas,summary_dict:dict):
)
if len(settings) > 0:
for m in settings:
# if focus key doesnt exist, create it
if 'focus' not in summary_dict[str(m.meta.run_uuid)].keys():
summary_dict[str(m.meta.run_uuid)]['focus'] = ''
if m.off_grid_flag:
summary_dict[str(m.meta.run_uuid)]['focus'] += "Off-grid,"

Expand Down

0 comments on commit 05bed60

Please sign in to comment.