mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handling aggregations storage to db
This commit is contained in:
parent
e12ff81aaa
commit
36718ab3be
2 changed files with 2 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ def aggregate_portfolio_recommendations(
|
|||
session.query(
|
||||
func.sum(Recommendation.estimated_cost).label("cost"),
|
||||
func.sum(Recommendation.total_work_hours).label("total_work_hours"),
|
||||
func.sum(Recommendation.adjusted_heat_demand).label("energy_savings"),
|
||||
func.sum(Recommendation.kwh_savings).label("energy_savings"),
|
||||
func.sum(Recommendation.co2_equivalent_savings).label("co2_equivalent_savings"),
|
||||
func.sum(Recommendation.energy_cost_savings).label("energy_cost_savings"),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ def extract_portfolio_aggregation_data(
|
|||
|
||||
pre_retrofit_energy_consumption = p.current_adjusted_energy
|
||||
post_retrofit_energy_consumption = p.current_adjusted_energy - sum(
|
||||
[r["adjusted_heat_demand"] for r in default_recommendations]
|
||||
[r["kwh_savings"] for r in default_recommendations]
|
||||
)
|
||||
|
||||
# Add up energy savings
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue