From 8f8a6dbf7109e038cdbf27507fe42f8215413190 Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Fri, 8 Sep 2023 05:05:58 -0400 Subject: [PATCH] small changes in importer --- hub/imports/results/energy_plus_workflow.py | 18 +++++++++--------- .../results/insel_monthly_energry_balance.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hub/imports/results/energy_plus_workflow.py b/hub/imports/results/energy_plus_workflow.py index 191337ea..cbe7988a 100644 --- a/hub/imports/results/energy_plus_workflow.py +++ b/hub/imports/results/energy_plus_workflow.py @@ -75,17 +75,17 @@ class EnergyPlusWorkflow: :return: None """ for building in self._city.buildings: - file_name = building.name + '_out' + '.csv' + file_name = f'{building.name}_out.csv' energy_plus_output_file_path = Path(self._base_path / file_name).resolve() if energy_plus_output_file_path.is_file(): - building.heating_demand[cte.HOUR] = self._building_energy_demands(energy_plus_output_file_path)['Heating (J)'] - building.cooling_demand[cte.HOUR] = self._building_energy_demands(energy_plus_output_file_path)['Cooling (J)'] - building.domestic_hot_water_heat_demand[cte.HOUR] = ( - self._building_energy_demands(energy_plus_output_file_path))['DHW (J)'] - building.appliances_electrical_demand[cte.HOUR] = ( - self._building_energy_demands(energy_plus_output_file_path))['Appliances (J)'] - building.lighting_electrical_demand[cte.HOUR] = ( - self._building_energy_demands(energy_plus_output_file_path))['Lighting (J)'] + building_energy_demands = self._building_energy_demands(energy_plus_output_file_path) + building.heating_demand[cte.HOUR] = building_energy_demands['Heating (J)'] + building.cooling_demand[cte.HOUR] = building_energy_demands['Cooling (J)'] + building.domestic_hot_water_heat_demand[cte.HOUR] = building_energy_demands['DHW (J)'] + building.appliances_electrical_demand[cte.HOUR] = building_energy_demands['Appliances (J)'] + 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])] diff --git a/hub/imports/results/insel_monthly_energry_balance.py b/hub/imports/results/insel_monthly_energry_balance.py index 34aab2ec..1e63bef2 100644 --- a/hub/imports/results/insel_monthly_energry_balance.py +++ b/hub/imports/results/insel_monthly_energry_balance.py @@ -112,7 +112,7 @@ class InselMonthlyEnergyBalance: :return: None """ for building in self._city.buildings: - file_name = building.name + '.out' + file_name = f'{building.name}.out' insel_output_file_path = Path(self._base_path / file_name).resolve() if insel_output_file_path.is_file(): building.heating_demand[cte.MONTH], building.cooling_demand[cte.MONTH] \