Skip to content

Commit 8d04979

Browse files
authored
Merge pull request #612 from NREL/chp-cost-update
Fix updating CHP.installed_cost_per_kw if scalar
2 parents 2753579 + 5c285c5 commit 8d04979

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

reoptjl/src/process_results.py

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def update_inputs_in_database(inputs_to_update: dict, run_uuid: str) -> None:
126126
SiteInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["Site"])
127127

128128
if inputs_to_update["CHP"]: # Will be an empty dictionary if CHP is not considered
129+
if inputs_to_update["CHP"].get("installed_cost_per_kw") and type(inputs_to_update["CHP"].get("installed_cost_per_kw")) == float:
130+
inputs_to_update["CHP"]["installed_cost_per_kw"] = [inputs_to_update["CHP"]["installed_cost_per_kw"]]
129131
CHPInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["CHP"])
130132
if inputs_to_update["SteamTurbine"]: # Will be an empty dictionary if SteamTurbine is not considered
131133
SteamTurbineInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["SteamTurbine"])

0 commit comments

Comments
 (0)