Skip to content

Commit

Permalink
Merge pull request #523 from NREL/develop
Browse files Browse the repository at this point in the history
Add GHP to summary endpoint for V3
  • Loading branch information
Bill-Becker authored Oct 6, 2023
2 parents 02fa6ab + 5afa145 commit fa92cca
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions reoptjl/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fa92cca

Please sign in to comment.