diff --git a/support_material/tutorial_2/main_level_2.py b/support_material/tutorial_2/main_level_2.py new file mode 100644 index 0000000..ae3f9df --- /dev/null +++ b/support_material/tutorial_2/main_level_2.py @@ -0,0 +1,28 @@ +from hub.imports.geometry_factory import GeometryFactory +from hub.helpers.dictionaries import Dictionaries +from hub.imports.construction_factory import ConstructionFactory +from hub.imports.usage_factory import UsageFactory +from hub.exports.energy_building_exports_factory import EnergyBuildingsExportsFactory + +geojson_file = './test_one_building.geojson' +city = GeometryFactory('geojson', + geojson_file, + height_field='citygml_me', + year_of_construction_field='ANNEE_CONS', + function_field='CODE_UTILI', + function_to_hub=Dictionaries().montreal_function_to_hub_function).city + +ConstructionFactory('nrcan', city).enrich() +UsageFactory('nrcan' , city).enrich() + +for building in city.buildings: + print(building.function) + for internal_zone in building.internal_zones: + for usage in internal_zone.usages: + print('Occupancy density in persons per m2:', usage.occupancy.occupancy_density) + for schedule in usage.occupancy.occupancy_schedules: + print(schedule.day_types, schedule.values) + +# Export to IDF (Energy+) +EnergyBuildingsExportsFactory('idf', city, './').export() +