2024-07-15 15:06:44 -04:00
|
|
|
"""
|
|
|
|
building_component module
|
|
|
|
Returns the summarize of envelope and energy systems
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2024 Concordia CERC group
|
|
|
|
Code contributors: Alireza Adli alireza.adli@concordia.ca
|
|
|
|
Mohammad Reza Seyedabadi mohammad.seyedabadi@mail.concordia.ca
|
|
|
|
"""
|
|
|
|
|
|
|
|
import glob
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
from hub.imports.geometry_factory import GeometryFactory
|
|
|
|
from hub.imports.construction_factory import ConstructionFactory
|
|
|
|
from hub.helpers.dictionaries import Dictionaries
|
|
|
|
|
|
|
|
|
|
|
|
class LCACarbonWorkflow:
|
|
|
|
def __init__(self, city_path):
|
2024-07-15 15:35:22 -04:00
|
|
|
file_path = (Path(__file__).parent / 'input_files' / city_path)
|
|
|
|
out_path = (Path(__file__).parent / 'out_files')
|
2024-07-15 15:06:44 -04:00
|
|
|
|
|
|
|
print('[simulation start]')
|
|
|
|
city = GeometryFactory('geojson',
|
|
|
|
path=file_path,
|
|
|
|
height_field='height',
|
|
|
|
year_of_construction_field='year_of_construction',
|
|
|
|
function_field='function',
|
|
|
|
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
|
|
|
|
print(f'city created from {file_path}')
|
|
|
|
ConstructionFactory('nrcan', city).enrich()
|
|
|
|
print(len(city.buildings[0].surfaces))
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
lca_calc = LCACarbonWorkflow('output_buildings_test.geojson')
|