diff --git a/CHANGELOG.md b/CHANGELOG.md index 82a64b5a2..20cdcd28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,11 @@ Classify the change according to the following categories: ##### Removed ### Patches +## v3.1.1 +### Minor Updates +##### Added +- Add GHP system sizes and borehole count in `queryset_for_summary()` function which is used for user runs summary information. + ## v3.1.0 ### Major Updates #### Changed diff --git a/reoptjl/views.py b/reoptjl/views.py index b2212bb25..c2d5e1d22 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -932,6 +932,24 @@ def queryset_for_summary(api_metas,summary_dict:dict): else: summary_dict[str(m.meta.run_uuid)]['chp_kw'] = m.size_kw + ghpOutputs = GHPOutputs.objects.filter(meta__run_uuid__in=run_uuids).only( + 'meta__run_uuid', + 'ghp_option_chosen', + 'ghpghx_chosen_outputs', + 'size_heat_pump_ton', + 'size_wwhp_heating_pump_ton', + 'size_wwhp_cooling_pump_ton' + ) + if len(ghpOutputs) > 0: + for m in ghpOutputs: + if m.ghp_option_chosen > 0: + if m.size_heat_pump_ton is not None: + summary_dict[str(m.meta.run_uuid)]['ghp_ton'] = m.size_heat_pump_ton + else: + summary_dict[str(m.meta.run_uuid)]['ghp_cooling_ton'] = m.size_wwhp_cooling_pump_ton + summary_dict[str(m.meta.run_uuid)]['ghp_heating_ton'] = m.size_wwhp_heating_pump_ton + summary_dict[str(m.meta.run_uuid)]['ghp_n_bores'] = m.ghpghx_chosen_outputs['number_of_boreholes'] + return summary_dict # Unlink a user_uuid from a run_uuid.