ready for students

This commit is contained in:
Pilar Monsalvete 2023-06-13 11:01:38 -04:00
parent 07dcffca87
commit c06cad2505

12
main.py
View File

@ -13,7 +13,7 @@ from hub.helpers.dictionaries import Dictionaries
sys.path.append('./')
try:
file_path = (Path(__file__).parent / 'data' / 'summerschool_all_buildings.geojson')
file_path = (Path(__file__).parent / 'data' / 'summerschool_onel_building.geojson')
out_path = (Path(__file__).parent / 'out_files')
files = glob.glob(f'{out_path}/*')
@ -29,8 +29,6 @@ try:
function_field='CODE_UTILI',
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
for building in city.buildings:
building.year_of_construction = 2022
print(f'city created from {file_path}')
ConstructionFactory('nrcan', city).enrich()
print('enrich constructions... done')
@ -39,20 +37,12 @@ try:
WeatherFactory('epw', city).enrich()
print('enrich weather... done')
for b in city.buildings:
print(b.name, b.function, b.year_of_construction, b.floor_area, b.storeys_above_ground)
print('exporting:')
_idf = EnergyBuildingsExportsFactory('idf', city, out_path).export()
print(' idf exported...')
_idf.run()
csv_file = str((out_path / f'{city.name}_out.csv').resolve())
eso_file = str((out_path / f'{city.name}_out.eso').resolve())
idf_file = str((out_path / f'{city.name}.idf').resolve())
print(f'info: {idf_file}, {csv_file}, {eso_file}')
print('[simulation end]')
except Exception as ex: