Skip to content

Commit

Permalink
Merge pull request #610 from NREL/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Bill-Becker authored Nov 11, 2024
2 parents b418203 + 76d5db4 commit 96856a7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ Classify the change according to the following categories:
##### Removed
### Patches

## v3.10.2
### Minor Updates
##### Changed
- Summary focus can now be a string with multiple types of focus such as `A,B,C`
##### Fixed
- Issue with `CHP.installed_cost_per_kw` not being an array when updating the inputs model object (which expects an array) in process_results.py, from Julia

## v3.10.1
### Minor Updates
##### Fixed
Expand Down
2 changes: 2 additions & 0 deletions reoptjl/src/process_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def update_inputs_in_database(inputs_to_update: dict, run_uuid: str) -> None:
SiteInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["Site"])

if inputs_to_update["CHP"]: # Will be an empty dictionary if CHP is not considered
if inputs_to_update["CHP"].get("installed_cost_per_kw") and type(inputs_to_update["CHP"].get("installed_cost_per_kw")) == float:
inputs_to_update["CHP"]["installed_cost_per_kw"] = [inputs_to_update["CHP"]["installed_cost_per_kw"]]
CHPInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["CHP"])
if inputs_to_update["SteamTurbine"]: # Will be an empty dictionary if SteamTurbine is not considered
SteamTurbineInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["SteamTurbine"])
Expand Down
16 changes: 8 additions & 8 deletions reoptjl/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,17 +1066,17 @@ 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 m.outage_start_time_step is None:
if len(m.outage_start_time_steps) == 0:
summary_dict[str(m.meta.run_uuid)]['focus'] = "Financial"
summary_dict[str(m.meta.run_uuid)]['focus'] += "Financial,"
else:
summary_dict[str(m.meta.run_uuid)]['focus'] = "Resilience"
summary_dict[str(m.meta.run_uuid)]['focus'] += "Resilience,"
summary_dict[str(m.meta.run_uuid)]['outage_duration'] = m.outage_durations[0] # all durations are same.
else:
# outage start timestep was provided, is 1 or more
summary_dict[str(m.meta.run_uuid)]['outage_duration'] = m.outage_end_time_step - m.outage_start_time_step + 1
summary_dict[str(m.meta.run_uuid)]['focus'] = "Resilience"
summary_dict[str(m.meta.run_uuid)]['focus'] += "Resilience,"

site = SiteOutputs.objects.filter(meta__run_uuid__in=run_uuids).only(
'meta__run_uuid',
Expand All @@ -1099,13 +1099,13 @@ def queryset_for_summary(api_metas,summary_dict:dict):
for m in site_inputs:
try: # can be NoneType
if m.renewable_electricity_min_fraction > 0:
summary_dict[str(m.meta.run_uuid)]['focus'] = "Clean-energy"
summary_dict[str(m.meta.run_uuid)]['focus'] += "Clean-energy,"
except:
pass # is NoneType

try: # can be NoneType
if m.renewable_electricity_max_fraction > 0:
summary_dict[str(m.meta.run_uuid)]['focus'] = "Clean-energy"
summary_dict[str(m.meta.run_uuid)]['focus'] += "Clean-energy,"
except:
pass # is NoneType

Expand All @@ -1119,10 +1119,10 @@ def queryset_for_summary(api_metas,summary_dict:dict):
if len(settings) > 0:
for m in settings:
if m.off_grid_flag:
summary_dict[str(m.meta.run_uuid)]['focus'] = "Off-grid"
summary_dict[str(m.meta.run_uuid)]['focus'] += "Off-grid,"

if m.include_climate_in_objective or m.include_health_in_objective:
summary_dict[str(m.meta.run_uuid)]['focus'] = "Clean-energy"
summary_dict[str(m.meta.run_uuid)]['focus'] += "Clean-energy,"

tariffInputs = ElectricTariffInputs.objects.filter(meta__run_uuid__in=run_uuids).only(
'meta__run_uuid',
Expand Down

0 comments on commit 96856a7

Please sign in to comment.