changed reading results to adapt to new results format
This commit is contained in:
parent
813449799e
commit
effdad4437
@ -14,8 +14,8 @@ class MonthlyEnergyBalanceEngine:
|
||||
self._city = city
|
||||
self._file_path = file_path
|
||||
EnergyBuildingsExportsFactory('insel_monthly_energy_balance', self._city, self._file_path).export()
|
||||
ResultFactory('insel_meb', self._city, self._file_path).enrich()
|
||||
self._run()
|
||||
ResultFactory('insel_meb', self._city, self._file_path).enrich()
|
||||
|
||||
def _run(self):
|
||||
"""
|
||||
|
19
results.py
19
results.py
@ -12,16 +12,23 @@ class Results:
|
||||
print_results = None
|
||||
file = 'city name: ' + self._city.name + '\n'
|
||||
for building in self._city.buildings:
|
||||
heating_results = building.heating[cte.MONTH].rename(columns={'INSEL': f'{building.name} heating Wh'})
|
||||
cooling_results = building.cooling[cte.MONTH].rename(columns={'INSEL': f'{building.name} cooling Wh'})
|
||||
heating_results = building.heating[cte.MONTH].rename(columns={cte.INSEL_MEB: f'{building.name} heating Wh'})
|
||||
cooling_results = building.cooling[cte.MONTH].rename(columns={cte.INSEL_MEB: f'{building.name} cooling Wh'})
|
||||
lighting_results = building.lighting_electrical_demand[cte.MONTH]\
|
||||
.rename(columns={cte.INSEL_MEB: f'{building.name} lighting electrical demand Wh'})
|
||||
appliances_results = building.appliances_electrical_demand[cte.MONTH]\
|
||||
.rename(columns={cte.INSEL_MEB: f'{building.name} appliances electrical demand Wh'})
|
||||
dhw_results = building.domestic_hot_water_heat_demand[cte.MONTH]\
|
||||
.rename(columns={cte.INSEL_MEB: f'{building.name} domestic hot water demand Wh'})
|
||||
if print_results is None:
|
||||
print_results = heating_results
|
||||
else:
|
||||
print_results = pd.concat([print_results, heating_results], axis='columns')
|
||||
print_results = pd.concat([print_results, cooling_results,
|
||||
building.lighting_electrical_demand,
|
||||
building.appliances_electrical_demand,
|
||||
building.domestic_hot_water_heat_demand], axis='columns')
|
||||
print_results = pd.concat([print_results,
|
||||
cooling_results,
|
||||
lighting_results,
|
||||
appliances_results,
|
||||
dhw_results], axis='columns')
|
||||
file += '\n'
|
||||
file += 'name: ' + building.name + '\n'
|
||||
file += 'year of construction: ' + str(building.year_of_construction) + '\n'
|
||||
|
Loading…
Reference in New Issue
Block a user