small changes in importer

This commit is contained in:
Pilar Monsalvete 2023-09-08 05:05:58 -04:00
parent 1392c05489
commit 8f8a6dbf71
2 changed files with 10 additions and 10 deletions

View File

@ -75,17 +75,17 @@ class EnergyPlusWorkflow:
:return: None :return: None
""" """
for building in self._city.buildings: 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() energy_plus_output_file_path = Path(self._base_path / file_name).resolve()
if energy_plus_output_file_path.is_file(): 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_energy_demands = self._building_energy_demands(energy_plus_output_file_path)
building.cooling_demand[cte.HOUR] = self._building_energy_demands(energy_plus_output_file_path)['Cooling (J)'] building.heating_demand[cte.HOUR] = building_energy_demands['Heating (J)']
building.domestic_hot_water_heat_demand[cte.HOUR] = ( building.cooling_demand[cte.HOUR] = building_energy_demands['Cooling (J)']
self._building_energy_demands(energy_plus_output_file_path))['DHW (J)'] building.domestic_hot_water_heat_demand[cte.HOUR] = building_energy_demands['DHW (J)']
building.appliances_electrical_demand[cte.HOUR] = ( building.appliances_electrical_demand[cte.HOUR] = building_energy_demands['Appliances (J)']
self._building_energy_demands(energy_plus_output_file_path))['Appliances (J)'] building.lighting_electrical_demand[cte.HOUR] = building_energy_demands['Lighting (J)']
building.lighting_electrical_demand[cte.HOUR] = ( # todo: @Saeed, this a list of ONE value with the total energy of the year, exactly the same as cte.YEAR.
self._building_energy_demands(energy_plus_output_file_path))['Lighting (J)'] # 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.heating_demand[cte.MONTH] = [sum(building.heating_demand[cte.HOUR])]
building.cooling_demand[cte.MONTH] = [sum(building.cooling_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.domestic_hot_water_heat_demand[cte.MONTH] = [sum(building.domestic_hot_water_heat_demand[cte.HOUR])]

View File

@ -112,7 +112,7 @@ class InselMonthlyEnergyBalance:
:return: None :return: None
""" """
for building in self._city.buildings: 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() insel_output_file_path = Path(self._base_path / file_name).resolve()
if insel_output_file_path.is_file(): if insel_output_file_path.is_file():
building.heating_demand[cte.MONTH], building.cooling_demand[cte.MONTH] \ building.heating_demand[cte.MONTH], building.cooling_demand[cte.MONTH] \