diff --git a/CHANGELOG.md b/CHANGELOG.md index bb961ce7a..f6e33c1d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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"]) 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',