changed print results format
This commit is contained in:
parent
d3aef403b1
commit
dbda4bae47
@ -94,25 +94,32 @@ class PeakLoads:
|
|||||||
|
|
||||||
self._results[building.name] = {'monthly heating peak load': monthly_heating_loads,
|
self._results[building.name] = {'monthly heating peak load': monthly_heating_loads,
|
||||||
'monthly cooling peak load': monthly_cooling_loads}
|
'monthly cooling peak load': monthly_cooling_loads}
|
||||||
print(self._results)
|
|
||||||
self._print_results()
|
self._print_results()
|
||||||
|
|
||||||
def _print_results(self):
|
def _print_results(self):
|
||||||
print_results = 'Peak loads in W'
|
print_results = f'Building name, monthly heating peak load W,,,,,,,,,,,, monthly cooling peak load W,,,,,,,,,,,'
|
||||||
for results in self._results:
|
for building in self._city.buildings:
|
||||||
|
results = self._results[building.name]
|
||||||
print_results += '\n'
|
print_results += '\n'
|
||||||
print_results += f'{results[0]}, {results[1]}, {results[2]}\n'
|
print_results += f'{building.name}, '
|
||||||
|
for value in results["monthly heating peak load"]:
|
||||||
|
print_results += f'{value}, '
|
||||||
|
for value in results["monthly cooling peak load"]:
|
||||||
|
print_results += f'{value}, '
|
||||||
|
|
||||||
file = 'city name: ' + self._city.name + '\n'
|
file = 'city name: ' + self._city.name + '\n'
|
||||||
for building in self._city.buildings:
|
for building in self._city.buildings:
|
||||||
file += '\n'
|
file += '\n'
|
||||||
file += 'name: ' + building.name + '\n'
|
file += f'name: {building.name}\n'
|
||||||
file += 'year of construction: ' + str(building.year_of_construction) + '\n'
|
file += f'year of construction: {building.year_of_construction}\n'
|
||||||
file += 'function: ' + building.function + '\n'
|
file += f'function: {building.function}\n'
|
||||||
file += 'floor area: ' + str(building.internal_zones[0].area) + '\n'
|
file += f'floor area: {building.floor_area}\n'
|
||||||
file += 'storeys: ' + str(building.storeys_above_ground) + '\n'
|
if building.average_storey_height is not None and building.eave_height is not None:
|
||||||
file += 'heated_volume: ' + str(0.85 * building.volume) + '\n'
|
file += f'storeys: {int(building.eave_height / building.average_storey_height)}\n'
|
||||||
file += 'volume: ' + str(building.volume) + '\n'
|
else:
|
||||||
|
file += f'storeys: n/a\n'
|
||||||
|
file += f'heated_volume: {0.85 * building.volume}\n'
|
||||||
|
file += f'volume: {building.volume}\n'
|
||||||
|
|
||||||
full_path_results = Path(self._path / 'peak_loads.csv').resolve()
|
full_path_results = Path(self._path / 'peak_loads.csv').resolve()
|
||||||
with open(full_path_results, 'w') as results_file:
|
with open(full_path_results, 'w') as results_file:
|
||||||
|
Loading…
Reference in New Issue
Block a user