diff --git a/hub/imports/retrofit_factory.py b/hub/imports/retrofit_factory.py index ac6a0205..f1b20ef6 100644 --- a/hub/imports/retrofit_factory.py +++ b/hub/imports/retrofit_factory.py @@ -12,22 +12,22 @@ class RetrofitFactory: self._apply_retrofit_to_building(building, wall_u_value, roof_u_value, ground_u_value) def _apply_retrofit_to_building(self, building: Building, wall_u_value, roof_u_value, ground_u_value): - for internal_zone in building.internal_zones: - print(internal_zone.id) + # for internal_zone in building.internal_zones: + # print(internal_zone.id) - for thermal_zone in internal_zone.thermal_zones_from_internal_zones: - for thermal_boundary in thermal_zone.thermal_boundaries: - if wall_u_value and thermal_boundary.type == cte.WALL: - print(thermal_boundary.u_value) - thermal_boundary.u_value = wall_u_value - print(thermal_boundary.u_value) - elif roof_u_value and thermal_boundary.type == cte.ROOF: - print("roof", thermal_boundary.u_value) - thermal_boundary.u_value = roof_u_value - print("roof", thermal_boundary.u_value) - elif ground_u_value and thermal_boundary.type == cte.GROUND: - thermal_boundary.u_value = ground_u_value - print("ground", thermal_boundary.u_value) + for thermal_zone in building.thermal_zones_from_internal_zones: + for thermal_boundary in thermal_zone.thermal_boundaries: + if wall_u_value and thermal_boundary.type == cte.WALL: + print(thermal_boundary.u_value) + thermal_boundary.u_value = wall_u_value + print(thermal_boundary.u_value) + elif roof_u_value and thermal_boundary.type == cte.ROOF: + print("roof", thermal_boundary.u_value) + thermal_boundary.u_value = roof_u_value + print("roof", thermal_boundary.u_value) + elif ground_u_value and thermal_boundary.type == cte.GROUND: + thermal_boundary.u_value = ground_u_value + print("ground", thermal_boundary.u_value) def enrich(self): # This method can be expanded to include different retrofit strategies diff --git a/main.py b/main.py index f245e8fc..ec7e1b1d 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,7 @@ from hub.helpers.dictionaries import Dictionaries from hub.imports.construction_factory import ConstructionFactory from hub.imports.usage_factory import UsageFactory from hub.imports.weather_factory import WeatherFactory +from hub.imports.retrofit_factory import RetrofitFactory # Specify the GeoJSON file path input_files_path = (Path(__file__).parent / 'input_files') input_files_path.mkdir(parents=True, exist_ok=True) @@ -23,6 +24,8 @@ city = GeometryFactory('geojson', # Enrich city data ConstructionFactory('cerc', city).enrich() UsageFactory('cerc', city).enrich() +RetrofitFactory('basic', city).enrich() + WeatherFactory('epw', city).enrich() energy_plus_workflow(city)