From cde3bfb4aefbfcc8b70d77b163c8cabb754a4a7d Mon Sep 17 00:00:00 2001 From: Saeed Ranjbar Date: Fri, 8 Sep 2023 11:50:20 -0400 Subject: [PATCH] tried to get monthly values from the method in helpers/monthly values. --- hub/imports/results/energy_plus_workflow.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hub/imports/results/energy_plus_workflow.py b/hub/imports/results/energy_plus_workflow.py index cbe7988a..627b3fd7 100644 --- a/hub/imports/results/energy_plus_workflow.py +++ b/hub/imports/results/energy_plus_workflow.py @@ -6,6 +6,7 @@ Project Coder Saeed Ranjbar saeed.ranjbar@concordia.ca Project collaborator Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca """ from pathlib import Path +from hub.helpers.monthly_values import MonthlyValues import csv import hub.helpers.constants as cte @@ -86,11 +87,14 @@ class EnergyPlusWorkflow: building.lighting_electrical_demand[cte.HOUR] = building_energy_demands['Lighting (J)'] # todo: @Saeed, this a list of ONE value with the total energy of the year, exactly the same as cte.YEAR. # You have to use the method to add hourly values from helpers/monthly_values - building.heating_demand[cte.MONTH] = [sum(building.heating_demand[cte.HOUR])] - building.cooling_demand[cte.MONTH] = [sum(building.cooling_demand[cte.HOUR])] - building.domestic_hot_water_heat_demand[cte.MONTH] = [sum(building.domestic_hot_water_heat_demand[cte.HOUR])] - building.appliances_electrical_demand[cte.MONTH] = [sum(building.appliances_electrical_demand[cte.HOUR])] - building.lighting_electrical_demand[cte.MONTH] = [sum(building.lighting_electrical_demand[cte.HOUR])] + building.heating_demand[cte.MONTH] = MonthlyValues.get_total_month(building.heating_demand[cte.HOUR]) + building.cooling_demand[cte.MONTH] = MonthlyValues.get_total_month(building.cooling_demand[cte.HOUR]) + building.domestic_hot_water_heat_demand[cte.MONTH] = ( + MonthlyValues.get_total_month(building.domestic_hot_water_heat_demand[cte.HOUR])) + building.appliances_electrical_demand[cte.MONTH] = ( + MonthlyValues.get_total_month(building.appliances_electrical_demand[cte.HOUR])) + building.lighting_electrical_demand[cte.MONTH] = ( + MonthlyValues.get_total_month(building.lighting_electrical_demand[cte.HOUR])) building.heating_demand[cte.YEAR] = [sum(building.heating_demand[cte.MONTH])] building.cooling_demand[cte.YEAR] = [sum(building.cooling_demand[cte.MONTH])] building.domestic_hot_water_heat_demand[cte.YEAR] = [sum(building.domestic_hot_water_heat_demand[cte.MONTH])]