Graphs prepared and ready for course and workshop

This commit is contained in:
Oriol Gavalda 2023-07-11 14:45:23 -04:00
parent 53b2227589
commit 6c4559b3d6

View File

@ -262,36 +262,16 @@ class Results:
columns=[ columns=[
f'{building.name} electrical consumption for distribution Wh']) f'{building.name} electrical consumption for distribution Wh'])
if print_results is None: listgraph = [lighting_results.values.sum(),appliances_results.values.sum(),
print_results = heating_results heating_consumption_results.values.sum(),
else: cooling_consumption_results.values.sum(),
print_results = pd.concat([print_results, heating_results], axis='columns') dhw_consumption_results.values.sum(),
print_results = pd.concat([print_results, extra_electrical_consumption.values.sum()
cooling_results, ]
lighting_results, total_final_energy = (lighting_results.values.sum() + appliances_results.values.sum() + \
appliances_results, heating_consumption_results.values.sum() + cooling_consumption_results.values.sum() + \
dhw_results, dhw_consumption_results.values.sum() + extra_electrical_consumption.values.sum())/1000
heating_consumption_results,
cooling_consumption_results, return listgraph, total_final_energy
dhw_consumption_results,
heating_peak_load_results,
cooling_peak_load_results,
electricity_peak_load_results,
onsite_electrical_production,
extra_electrical_consumption], axis='columns')
file += '\n'
file += f'name: {building.name}\n'
file += f'year of construction: {building.year_of_construction}\n'
file += f'function: {building.function}\n'
file += f'floor area: {building.floor_area}\n'
if building.average_storey_height is not None and building.eave_height is not None:
file += f'storeys: {int(building.eave_height / building.average_storey_height)}\n'
else:
file += f'storeys: n/a\n'
file += f'volume: {building.volume}\n'
full_path_results = Path(self._path / 'demand.csv').resolve()
print_results.to_csv(full_path_results, na_rep='null')
full_path_metadata = Path(self._path / 'metadata.csv').resolve()
with open(full_path_metadata, 'w') as metadata_file:
metadata_file.write(file)