hub/main.py

28 lines
830 B
Python

from hub.imports.geometry_factory import GeometryFactory
from hub.helpers.dictionaries import Dictionaries
from hub.imports.results.archetype_based_demand import DemandEnricher
import os
import psycopg2
import csv
input_file = "data/cmm_points_function_vintage_surface.csv"
output_file = "output_buildings.csv"
# Initialize city object from GeometryFactory
city = GeometryFactory(
file_type="csv",
path=input_file,
centroid_x_field="centroid_x",
centroid_y_field="centroid_y",
year_of_construction_field="anne_cnstr",
function_field="code_util",
function_to_hub=Dictionaries().montreal_function_to_hub_function,
total_floor_area_field="supfi_etag"
).city
demand_enricher = DemandEnricher('./data/energy_demand_data.csv')
# Enrich the city object
demand_enricher.enrich_city(city)
print("done")