From f0125065fc4a595bf400c23f757505dced70b245 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Tue, 22 Oct 2024 10:15:37 -0400 Subject: [PATCH 1/5] Update views.py --- reoptjl/views.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 2bd5e1651..a110631c8 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -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', @@ -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 @@ -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', From 83130d48d0384a0e64943dd216f9770b14f927ea Mon Sep 17 00:00:00 2001 From: Bhavesh Rathod <83797218+rathod-b@users.noreply.github.com> Date: Thu, 24 Oct 2024 08:44:06 -0400 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb961ce7a..130c106f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,11 @@ Classify the change according to the following categories: ##### Removed ### Patches +## Develop - 2024-10-24 +### Minor Updates +##### Changed +- Summary focus can now be a string with multiple types of focus such as `A,B,C` + ## v3.10.1 ### Minor Updates ##### Fixed From fc989bacab10354ec16f65e04c0d939f1f293269 Mon Sep 17 00:00:00 2001 From: Bhavesh Rathod <83797218+rathod-b@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:25:08 -0400 Subject: [PATCH 3/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 130c106f8..222e84ba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ Classify the change according to the following categories: ##### Removed ### Patches -## Develop - 2024-10-24 +## v3.10.2 ### Minor Updates ##### Changed - Summary focus can now be a string with multiple types of focus such as `A,B,C` From 5c285c5e6c5596e60e6fe2a4c7ea4b3a42694b98 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 1 Nov 2024 11:42:27 -0600 Subject: [PATCH 4/5] Fix updating CHP.installed_cost_per_kw if scalar --- reoptjl/src/process_results.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reoptjl/src/process_results.py b/reoptjl/src/process_results.py index 87023850b..dd22d08e5 100644 --- a/reoptjl/src/process_results.py +++ b/reoptjl/src/process_results.py @@ -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"]) From 76d5db4da12af4f8a6fdb63dc317591f8587538e Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:56:16 -0700 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 222e84ba0..f6e33c1d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ Classify the change according to the following categories: ### 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