Skip to content

Commit

Permalink
Fix updating CHP.installed_cost_per_kw if scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Becker committed Nov 1, 2024
1 parent fd2965d commit 5c285c5
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 5c285c5

Please sign in to comment.