From 5637f219f80c7dc029976645768bc86585fcaf6c Mon Sep 17 00:00:00 2001 From: guille Date: Tue, 14 Mar 2023 11:28:34 -0400 Subject: [PATCH] Correct small bug in merge city --- hub/city_model_structure/city.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hub/city_model_structure/city.py b/hub/city_model_structure/city.py index 1aebd170..5f4da399 100644 --- a/hub/city_model_structure/city.py +++ b/hub/city_model_structure/city.py @@ -459,6 +459,7 @@ class City: for surface in city_object.surfaces: radiation = surface.global_irradiance if 'year' not in radiation and 'month' not in radiation: + continue elif "year" in radiation: building_radiation += radiation["year"].iloc[0] @@ -468,11 +469,11 @@ class City: if building_radiation < min_radiation: min_radiation = building_radiation selected_city_object = city_object - # merge the city object with the minimum radiation - if selected_city_object is not None: - _merge_city.add_city_object(selected_city_object) - else: - _merge_city.add_city_object(building) + # merge the city object with the minimum radiation + if selected_city_object is not None: + _merge_city.add_city_object(selected_city_object) + else: + _merge_city.add_city_object(building) return _merge_city @property