From a147afe76fbf9deac752f373b1503b52ea27eee6 Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Mon, 31 Jul 2023 17:01:35 -0400 Subject: [PATCH] modified thermal zones to be created in different ways depending on the user needs --- hub/city_model_structure/building.py | 23 +++---- .../building_demand/internal_zone.py | 30 +++++--- .../building_demand/thermal_zone.py | 44 +++++++++--- hub/exports/building_energy/energy_ade.py | 2 +- hub/exports/building_energy/idf.py | 14 ++-- .../insel/insel_monthly_energy_balance.py | 10 +-- .../peak_calculation/loads_calculation.py | 12 ++-- hub/helpers/thermal_zones_creation.py | 68 +------------------ .../results/insel_monthly_energry_balance.py | 4 +- hub/persistence/models/city_object.py | 2 +- tests/test_construction_factory.py | 20 +++--- tests/test_custom_insel_block.py | 2 +- tests/test_enrichement.py | 12 ++-- tests/test_geometry_factory.py | 2 +- tests/test_insel_exports.py | 2 +- 15 files changed, 109 insertions(+), 138 deletions(-) diff --git a/hub/city_model_structure/building.py b/hub/city_model_structure/building.py index 3c318232..29a2862a 100644 --- a/hub/city_model_structure/building.py +++ b/hub/city_model_structure/building.py @@ -41,7 +41,7 @@ class Building(CityObject): self._floor_area = None self._roof_type = None self._internal_zones = None - self._thermal_zones = None + self._thermal_zones_from_internal_zones = None self._shell = None self._aliases = [] self._type = 'building' @@ -118,22 +118,19 @@ class Building(CityObject): return self._internal_zones @property - def thermal_zones(self) -> Union[None, List[ThermalZone]]: + def thermal_zones_from_internal_zones(self) -> Union[None, List[ThermalZone]]: """ Get building thermal zones - For Lod up to 3, there can be more than one thermal zone per internal zone. - In LoD 4, there can be more than one internal zone, and therefore, only one thermal zone per internal zone :return: [ThermalZone] """ - if self._thermal_zones is None: - self._thermal_zones = [] + if self._thermal_zones_from_internal_zones is None: + self._thermal_zones_from_internal_zones = [] for internal_zone in self.internal_zones: - if internal_zone.thermal_zones is None: - self._thermal_zones = None - return self._thermal_zones - for thermal_zone in internal_zone.thermal_zones: - self._thermal_zones.append(thermal_zone) - return self._thermal_zones + if internal_zone.thermal_zones_from_internal_zones is None: + self._thermal_zones_from_internal_zones = None + return self._thermal_zones_from_internal_zones + self._thermal_zones_from_internal_zones.append(internal_zone.thermal_zones_from_internal_zones[0]) + return self._thermal_zones_from_internal_zones @property def grounds(self) -> List[Surface]: @@ -621,7 +618,7 @@ class Building(CityObject): def _calculate_working_hours(self): _working_hours = {} for internal_zone in self.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: _working_hours_per_thermal_zone = {} for schedule in thermal_zone.thermal_control.hvac_availability_schedules: _working_hours_per_schedule = [0] * len(schedule.values) diff --git a/hub/city_model_structure/building_demand/internal_zone.py b/hub/city_model_structure/building_demand/internal_zone.py index 6bc2f776..aa2cefa5 100644 --- a/hub/city_model_structure/building_demand/internal_zone.py +++ b/hub/city_model_structure/building_demand/internal_zone.py @@ -9,9 +9,9 @@ import uuid from typing import Union, List from hub.city_model_structure.building_demand.usage import Usage from hub.city_model_structure.building_demand.thermal_zone import ThermalZone +from hub.city_model_structure.building_demand.thermal_boundary import ThermalBoundary from hub.city_model_structure.attributes.polyhedron import Polyhedron from hub.city_model_structure.energy_systems.hvac_system import HvacSystem -from hub.helpers.thermal_zones_creation import ThermalZonesCreation class InternalZone: @@ -24,7 +24,7 @@ class InternalZone: self._geometry = None self._volume = volume self._area = area - self._thermal_zones = None + self._thermal_zones_from_internal_zones = None self._usages = None self._hvac_system = None @@ -108,17 +108,29 @@ class InternalZone: self._hvac_system = value @property - def thermal_zones(self) -> Union[None, List[ThermalZone]]: + def thermal_zones_from_internal_zones(self) -> Union[None, List[ThermalZone]]: """ - Get building thermal zones + Get building thermal zones as one per internal zone :return: [ThermalZone] """ - return self._thermal_zones + _thermal_boundaries = [] + for surface in self.surfaces: + if surface.holes_polygons is None: + windows_areas = None + else: + windows_areas = [] + for hole in surface.holes_polygons: + windows_areas.append(hole.area) + _thermal_boundary = ThermalBoundary(surface, surface.solid_polygon.area, windows_areas) + _thermal_boundaries.append(_thermal_boundary) + _thermal_zone = ThermalZone(_thermal_boundaries, self, self.volume, self.area) + self._thermal_zones_from_internal_zones = [_thermal_zone] + return self._thermal_zones_from_internal_zones - @thermal_zones.setter - def thermal_zones(self, value): + @thermal_zones_from_internal_zones.setter + def thermal_zones_from_internal_zones(self, value): """ - Set city object thermal zones + Set city object thermal zones as one per internal zone :param value: [ThermalZone] """ - self._thermal_zones = value + self._thermal_zones_from_internal_zones = value diff --git a/hub/city_model_structure/building_demand/thermal_zone.py b/hub/city_model_structure/building_demand/thermal_zone.py index 8d4886d4..42cbfa78 100644 --- a/hub/city_model_structure/building_demand/thermal_zone.py +++ b/hub/city_model_structure/building_demand/thermal_zone.py @@ -221,15 +221,43 @@ class ThermalZone: Get thermal zone view factors matrix :return: [[float]] """ - return self._view_factors_matrix + # todo: review method if windows not in window_ratio but in geometry + if self._view_factors_matrix is None: + total_area = 0 + for thermal_boundary in self.thermal_boundaries: + total_area += thermal_boundary.opaque_area + for thermal_opening in thermal_boundary.thermal_openings: + total_area += thermal_opening.area - @view_factors_matrix.setter - def view_factors_matrix(self, value): - """ - Set thermal zone view factors matrix - :param value: [[float]] - """ - self._view_factors_matrix = value + view_factors_matrix = [] + for thermal_boundary_1 in self.thermal_boundaries: + values = [] + for thermal_boundary_2 in self.thermal_boundaries: + value = 0 + if thermal_boundary_1.id != thermal_boundary_2.id: + value = thermal_boundary_2.opaque_area / (total_area - thermal_boundary_1.opaque_area) + values.append(value) + for thermal_boundary in self.thermal_boundaries: + for thermal_opening in thermal_boundary.thermal_openings: + value = thermal_opening.area / (total_area - thermal_boundary_1.opaque_area) + values.append(value) + view_factors_matrix.append(values) + + for thermal_boundary_1 in self.thermal_boundaries: + values = [] + for thermal_opening_1 in thermal_boundary_1.thermal_openings: + for thermal_boundary_2 in self.thermal_boundaries: + value = thermal_boundary_2.opaque_area / (total_area - thermal_opening_1.area) + values.append(value) + for thermal_boundary in self.thermal_boundaries: + for thermal_opening_2 in thermal_boundary.thermal_openings: + value = 0 + if thermal_opening_1.id != thermal_opening_2.id: + value = thermal_opening_2.area / (total_area - thermal_opening_1.area) + values.append(value) + view_factors_matrix.append(values) + self._view_factors_matrix = view_factors_matrix + return self._view_factors_matrix @property def usage_name(self) -> Union[None, str]: diff --git a/hub/exports/building_energy/energy_ade.py b/hub/exports/building_energy/energy_ade.py index bd9dc735..f1365fed 100644 --- a/hub/exports/building_energy/energy_ade.py +++ b/hub/exports/building_energy/energy_ade.py @@ -335,7 +335,7 @@ class EnergyAde: def _thermal_zones(self, building, city): thermal_zones = [] for internal_zone in building.internal_zones: - for index, thermal_zone in enumerate(internal_zone.thermal_zones): + for index, thermal_zone in enumerate(internal_zone.thermal_zones_from_internal_zones): usages = [] for usage in internal_zone.usages: usages.append({'@xlink:href': f'#GML_{usage.id}'}) diff --git a/hub/exports/building_energy/idf.py b/hub/exports/building_energy/idf.py index 898beb55..5d07e709 100644 --- a/hub/exports/building_energy/idf.py +++ b/hub/exports/building_energy/idf.py @@ -510,9 +510,9 @@ class Idf: for building in self._city.buildings: print('building name', building.name) for internal_zone in building.internal_zones: - if internal_zone.thermal_zones is None: + if internal_zone.thermal_zones_from_internal_zones is None: continue - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: for thermal_boundary in thermal_zone.thermal_boundaries: self._add_construction(thermal_boundary) if thermal_boundary.parent_surface.vegetation is not None: @@ -556,7 +556,7 @@ class Idf: self._add_dhw(thermal_zone, building.name) if self._export_type == "Surfaces": if building.name in self._target_buildings or building.name in self._adjacent_buildings: - if building.internal_zones[0].thermal_zones is not None: + if building.internal_zones[0].thermal_zones_from_internal_zones is not None: self._add_surfaces(building, building.name) else: self._add_pure_geometry(building, building.name) @@ -611,7 +611,7 @@ class Idf: num_stories=int(building.storeys_above_ground)) for surface in self._idf.idfobjects[self._SURFACE]: - for thermal_zone in building.thermal_zones: + for thermal_zone in building.thermal_zones_from_internal_zones: for boundary in thermal_zone.thermal_boundaries: if surface.Type == self.idf_surfaces[boundary.surface.type]: surface.Construction_Name = boundary.construction_name @@ -664,7 +664,7 @@ class Idf: idf_surface.setcoords(coordinates) if self._lod >= 3: for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: for boundary in thermal_zone.thermal_boundaries: self._add_windows_by_vertices(boundary) else: @@ -674,7 +674,7 @@ class Idf: def _add_surfaces(self, building, zone_name): for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: for boundary in thermal_zone.thermal_boundaries: idf_surface_type = self.idf_surfaces[boundary.parent_surface.type] outside_boundary_condition = 'Outdoors' @@ -711,7 +711,7 @@ class Idf: if self._lod >= 3: for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: for boundary in thermal_zone.thermal_boundaries: self._add_windows_by_vertices(boundary) else: diff --git a/hub/exports/building_energy/insel/insel_monthly_energy_balance.py b/hub/exports/building_energy/insel/insel_monthly_energy_balance.py index 7055f55a..3509c7c6 100644 --- a/hub/exports/building_energy/insel/insel_monthly_energy_balance.py +++ b/hub/exports/building_energy/insel/insel_monthly_energy_balance.py @@ -44,7 +44,7 @@ class InselMonthlyEnergyBalance: self._insel_files_paths.append(building.name + '.insel') file_name_out = building.name + '.out' output_path = Path(self._path / file_name_out).resolve() - if building.thermal_zones is None: + if building.thermal_zones_from_internal_zones is None: logging.warning('Building %s has missing values. Monthly Energy Balance cannot be processed', building.name) self._contents.append( @@ -126,7 +126,7 @@ class InselMonthlyEnergyBalance: # todo: this method and the insel model have to be reviewed for more than one internal zone internal_zone = building.internal_zones[0] - thermal_zone = internal_zone.thermal_zones[0] + thermal_zone = internal_zone.thermal_zones_from_internal_zones[0] parameters.append(f'{thermal_zone.indirectly_heated_area_ratio} % BP(6) Indirectly heated area ratio') parameters.append(f'{thermal_zone.effective_thermal_capacity / 3600 / building.average_storey_height}' f' % BP(7) Effective heat capacity (Wh/m2K)') @@ -139,7 +139,7 @@ class InselMonthlyEnergyBalance: for i, usage in enumerate(internal_zone.usages): percentage_usage = usage.percentage - parameters.append(f'{internal_zone.thermal_zones[0].total_floor_area * percentage_usage} ' + parameters.append(f'{internal_zone.thermal_zones_from_internal_zones[0].total_floor_area * percentage_usage} ' f'% BP(11) #1 Area of zone {i + 1} (m2)') total_internal_gain = 0 for i_gain in usage.internal_gains: @@ -169,11 +169,11 @@ class InselMonthlyEnergyBalance: infiltration_day = 0 for value in schedule.values: if value == 0: - infiltration_day += internal_zone.thermal_zones[0].infiltration_rate_system_off / 24 + infiltration_day += internal_zone.thermal_zones_from_internal_zones[0].infiltration_rate_system_off / 24 ventilation_day += 0 else: ventilation_value = usage.mechanical_air_change * value - infiltration_value = internal_zone.thermal_zones[0].infiltration_rate_system_off * value + infiltration_value = internal_zone.thermal_zones_from_internal_zones[0].infiltration_rate_system_off * value if ventilation_value >= infiltration_value: ventilation_day += ventilation_value / 24 infiltration_day += 0 diff --git a/hub/helpers/peak_calculation/loads_calculation.py b/hub/helpers/peak_calculation/loads_calculation.py index 5a18867b..63f1ed87 100644 --- a/hub/helpers/peak_calculation/loads_calculation.py +++ b/hub/helpers/peak_calculation/loads_calculation.py @@ -65,7 +65,7 @@ class LoadsCalculation: """ heating_load_transmitted = 0 for internal_zone in self._building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: internal_temperature = thermal_zone.thermal_control.mean_heating_set_point heating_load_transmitted += self._get_load_transmitted(thermal_zone, internal_temperature, ambient_temperature, ground_temperature) @@ -78,7 +78,7 @@ class LoadsCalculation: """ cooling_load_transmitted = 0 for internal_zone in self._building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: internal_temperature = thermal_zone.thermal_control.mean_cooling_set_point cooling_load_transmitted += self._get_load_transmitted(thermal_zone, internal_temperature, ambient_temperature, ground_temperature) @@ -91,7 +91,7 @@ class LoadsCalculation: """ heating_ventilation_load = 0 for internal_zone in self._building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: internal_temperature = thermal_zone.thermal_control.mean_heating_set_point heating_ventilation_load += self._get_load_ventilation(thermal_zone, internal_temperature, ambient_temperature) return heating_ventilation_load @@ -103,7 +103,7 @@ class LoadsCalculation: """ cooling_ventilation_load = 0 for internal_zone in self._building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: internal_temperature = thermal_zone.thermal_control.mean_cooling_set_point cooling_ventilation_load += self._get_load_ventilation(thermal_zone, internal_temperature, ambient_temperature) return cooling_ventilation_load @@ -117,7 +117,7 @@ class LoadsCalculation: cooling_load_lighting = 0 cooling_load_equipment_sensible = 0 for internal_zone in self._building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: cooling_load_occupancy_sensible += (thermal_zone.occupancy.sensible_convective_internal_gain + thermal_zone.occupancy.sensible_radiative_internal_gain) \ * thermal_zone.footprint_area @@ -139,7 +139,7 @@ class LoadsCalculation: """ cooling_load_radiation = 0 for internal_zone in self._building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: for thermal_boundary in thermal_zone.thermal_boundaries: for thermal_opening in thermal_boundary.thermal_openings: radiation = thermal_boundary.parent_surface.global_irradiance[cte.HOUR][irradiance_format][hour] diff --git a/hub/helpers/thermal_zones_creation.py b/hub/helpers/thermal_zones_creation.py index 1f5edc2e..31398ae9 100644 --- a/hub/helpers/thermal_zones_creation.py +++ b/hub/helpers/thermal_zones_creation.py @@ -6,8 +6,6 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca """ from hub.imports.construction.helpers.storeys_generation import StoreysGeneration -from hub.city_model_structure.building_demand.thermal_zone import ThermalZone -from hub.city_model_structure.building_demand.thermal_boundary import ThermalBoundary class ThermalZonesCreation: @@ -50,28 +48,6 @@ class ThermalZonesCreation: # thermal_boundary.window_ratio = \ # float(catalog_construction.window_ratio['west']) / 100 - @property - def thermal_zones_from_internal_zones(self) -> [ThermalZone]: - """ - Create and get thermal zones as 1 per each internal zone - :return: [ThermalZone] - """ - _thermal_zones = [] - _thermal_boundaries = [] - for internal_zone in self._building.internal_zones: - for surface in internal_zone.surfaces: - if surface.holes_polygons is None: - windows_areas = None - else: - windows_areas = [] - for hole in surface.holes_polygons: - windows_areas.append(hole.area) - _thermal_boundary = ThermalBoundary(surface, surface.solid_polygon.area, windows_areas) - _thermal_boundaries.append(_thermal_boundary) - _thermal_zone = ThermalZone(_thermal_boundaries, internal_zone, internal_zone.volume, internal_zone.floor_area) - _thermal_zones.append(_thermal_zone) - return _thermal_zones - @property def thermal_zones_from_storeys(self): """ @@ -85,49 +61,7 @@ class ThermalZonesCreation: building.average_storey_height = archetype.average_storey_height thermal_zones = StoreysGeneration(building, building.internal_zones[0], divide_in_storeys=divide_in_storeys).thermal_zones - building.internal_zones[0].thermal_zones = thermal_zones - - # todo: verify windows - @staticmethod - def _calculate_view_factors(thermal_zone): - """ - Get thermal zone view factors matrix - :return: [[float]] - """ - total_area = 0 - for thermal_boundary in thermal_zone.thermal_boundaries: - total_area += thermal_boundary.opaque_area - for thermal_opening in thermal_boundary.thermal_openings: - total_area += thermal_opening.area - - view_factors_matrix = [] - for thermal_boundary_1 in thermal_zone.thermal_boundaries: - values = [] - for thermal_boundary_2 in thermal_zone.thermal_boundaries: - value = 0 - if thermal_boundary_1.id != thermal_boundary_2.id: - value = thermal_boundary_2.opaque_area / (total_area - thermal_boundary_1.opaque_area) - values.append(value) - for thermal_boundary in thermal_zone.thermal_boundaries: - for thermal_opening in thermal_boundary.thermal_openings: - value = thermal_opening.area / (total_area - thermal_boundary_1.opaque_area) - values.append(value) - view_factors_matrix.append(values) - - for thermal_boundary_1 in thermal_zone.thermal_boundaries: - values = [] - for thermal_opening_1 in thermal_boundary_1.thermal_openings: - for thermal_boundary_2 in thermal_zone.thermal_boundaries: - value = thermal_boundary_2.opaque_area / (total_area - thermal_opening_1.area) - values.append(value) - for thermal_boundary in thermal_zone.thermal_boundaries: - for thermal_opening_2 in thermal_boundary.thermal_openings: - value = 0 - if thermal_opening_1.id != thermal_opening_2.id: - value = thermal_opening_2.area / (total_area - thermal_opening_1.area) - values.append(value) - view_factors_matrix.append(values) - thermal_zone.view_factors_matrix = view_factors_matrix + building.internal_zones[0].thermal_zones_from_internal_zones = thermal_zones @staticmethod def _search_construction_in_archetype(archetype, construction_type): diff --git a/hub/imports/results/insel_monthly_energry_balance.py b/hub/imports/results/insel_monthly_energry_balance.py index 4450991d..6cd1409b 100644 --- a/hub/imports/results/insel_monthly_energry_balance.py +++ b/hub/imports/results/insel_monthly_energry_balance.py @@ -45,12 +45,12 @@ class InselMonthlyEnergyBalance: domestic_hot_water_demand = [] lighting_demand = [] appliances_demand = [] - if building.internal_zones[0].thermal_zones is None: + if building.internal_zones[0].thermal_zones_from_internal_zones is None: domestic_hot_water_demand = [0] * 12 lighting_demand = [0] * 12 appliances_demand = [0] * 12 else: - thermal_zone = building.internal_zones[0].thermal_zones[0] + thermal_zone = building.internal_zones[0].thermal_zones_from_internal_zones[0] area = thermal_zone.total_floor_area cold_water = building.cold_water_temperature[cte.MONTH]['epw'] peak_flow = thermal_zone.domestic_hot_water.peak_flow diff --git a/hub/persistence/models/city_object.py b/hub/persistence/models/city_object.py index b7f2ace9..d6044e71 100644 --- a/hub/persistence/models/city_object.py +++ b/hub/persistence/models/city_object.py @@ -58,7 +58,7 @@ class CityObject(Models): self.wall_area = wall_area window_ratio = 0 for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: for thermal_boundary in thermal_zone.thermal_boundaries: window_ratio = thermal_boundary.window_ratio break diff --git a/tests/test_construction_factory.py b/tests/test_construction_factory.py index 8a3fe556..d56441c2 100644 --- a/tests/test_construction_factory.py +++ b/tests/test_construction_factory.py @@ -106,7 +106,7 @@ class TestConstructionFactory(TestCase): self.assertIsNotNone(building.shell, 'building shell is none') def _check_thermal_zones(self, internal_zone): - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self.assertIsNotNone(thermal_zone.id, 'thermal_zone id is none') self.assertIsNotNone(thermal_zone.footprint_area, 'thermal_zone floor area is none') self.assertTrue(len(thermal_zone.thermal_boundaries) > 0, 'thermal_zone thermal_boundaries not defined') @@ -133,7 +133,7 @@ class TestConstructionFactory(TestCase): for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.id, 'thermal_boundary id is none') self.assertIsNotNone(thermal_boundary.parent_surface, 'thermal_boundary surface is none') - self.assertIsNotNone(thermal_boundary.thermal_zones, 'thermal_boundary delimits no thermal zone') + self.assertIsNotNone(thermal_boundary.thermal_zones_from_internal_zones, 'thermal_boundary delimits no thermal zone') self.assertIsNotNone(thermal_boundary.opaque_area, 'thermal_boundary area is none') self.assertIsNotNone(thermal_boundary.thickness, 'thermal_boundary thickness is none') self.assertIsNotNone(thermal_boundary.type, 'thermal_boundary type is none') @@ -184,7 +184,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') @@ -202,7 +202,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') @@ -220,7 +220,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') @@ -238,7 +238,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') @@ -256,7 +256,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') @@ -277,7 +277,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') @@ -299,7 +299,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') @@ -321,7 +321,7 @@ class TestConstructionFactory(TestCase): for building in city.buildings: for internal_zone in building.internal_zones: self._check_thermal_zones(internal_zone) - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_boundaries(thermal_zone) for thermal_boundary in thermal_zone.thermal_boundaries: self.assertIsNotNone(thermal_boundary.layers, 'layers is none') diff --git a/tests/test_custom_insel_block.py b/tests/test_custom_insel_block.py index b8683bd2..1b46995d 100644 --- a/tests/test_custom_insel_block.py +++ b/tests/test_custom_insel_block.py @@ -115,7 +115,7 @@ class TestExports(TestCase): self.assertIsNotNone(building.basement_heated, f'building {building.name} basement_heated is none') for internal_zone in building.internal_zones: self.assertIsNotNone(internal_zone.area, f'internal zone {internal_zone.id} area is none') - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self.assertIsNotNone(thermal_zone.indirectly_heated_area_ratio, f'thermal zone {thermal_zone.id} ' f'indirectly_heated_area_ratio is none') self.assertIsNotNone(thermal_zone.effective_thermal_capacity, f'thermal zone {thermal_zone.id} ' diff --git a/tests/test_enrichement.py b/tests/test_enrichement.py index 4dd6d0e4..531acd6a 100644 --- a/tests/test_enrichement.py +++ b/tests/test_enrichement.py @@ -38,7 +38,7 @@ class TestGeometryFactory(TestCase): self.assertIsNot(len(internal_zone.usages), 0, 'no building usages defined') for usage in internal_zone.usages: self.assertIsNotNone(usage.id, 'usage id is none') - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_thermal_zone(thermal_zone) def _check_buildings(self, city): @@ -46,7 +46,7 @@ class TestGeometryFactory(TestCase): self.assertIsNotNone(building.internal_zones, 'no internal zones created') for internal_zone in building.internal_zones: self.assertIsNotNone(internal_zone.usages, 'usage zones are not defined') - self.assertIsNotNone(internal_zone.thermal_zones, 'thermal zones are not defined') + self.assertIsNotNone(internal_zone.thermal_zones_from_internal_zones, 'thermal zones are not defined') self.assertIsNone(building.basement_heated, 'building basement_heated is not none') self.assertIsNone(building.attic_heated, 'building attic_heated is not none') self.assertIsNotNone(building.average_storey_height, 'building average_storey_height is none') @@ -105,7 +105,7 @@ class TestGeometryFactory(TestCase): if usage_key == 'comnet': for building in city.buildings: for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_extra_thermal_zone(thermal_zone) # usage factory called first city = self._get_citygml(file) @@ -117,7 +117,7 @@ class TestGeometryFactory(TestCase): if usage_key == 'comnet': for building in city.buildings: for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_extra_thermal_zone(thermal_zone) def _test_pluto(self, file): @@ -135,7 +135,7 @@ class TestGeometryFactory(TestCase): if usage_key == 'comnet': for building in city.buildings: for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_extra_thermal_zone(thermal_zone) # usage factory called first city = self._get_citygml(file) @@ -147,7 +147,7 @@ class TestGeometryFactory(TestCase): if usage_key == 'comnet': for building in city.buildings: for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self._check_extra_thermal_zone(thermal_zone) def test_enrichment(self): diff --git a/tests/test_geometry_factory.py b/tests/test_geometry_factory.py index c4ade93b..c098748a 100644 --- a/tests/test_geometry_factory.py +++ b/tests/test_geometry_factory.py @@ -62,7 +62,7 @@ class TestGeometryFactory(TestCase): self.assertIsNotNone(building.internal_zones, 'building internal zones is none') for internal_zone in building.internal_zones: self.assertIsNone(internal_zone.usages, 'usage zones are defined') - self.assertIsNone(internal_zone.thermal_zones, 'thermal zones are defined') + self.assertIsNone(internal_zone.thermal_zones_from_internal_zones, 'thermal zones are defined') self.assertIsNone(building.basement_heated, 'building basement_heated is not none') self.assertIsNone(building.attic_heated, 'building attic_heated is not none') self.assertIsNone(building.terrains, 'building terrains is not none') diff --git a/tests/test_insel_exports.py b/tests/test_insel_exports.py index ef987000..57604b07 100644 --- a/tests/test_insel_exports.py +++ b/tests/test_insel_exports.py @@ -115,7 +115,7 @@ class TestExports(TestCase): self.assertIsNotNone(building.basement_heated, f'building {building.name} basement_heated is none') for internal_zone in building.internal_zones: self.assertIsNotNone(internal_zone.area, f'internal zone {internal_zone.id} area is none') - for thermal_zone in internal_zone.thermal_zones: + for thermal_zone in internal_zone.thermal_zones_from_internal_zones: self.assertIsNotNone(thermal_zone.indirectly_heated_area_ratio, f'thermal zone {thermal_zone.id} ' f'indirectly_heated_area_ratio is none') self.assertIsNotNone(thermal_zone.effective_thermal_capacity, f'thermal zone {thermal_zone.id} '