diff --git a/hub/city_model_structure/building_demand/thermal_control.py b/hub/city_model_structure/building_demand/thermal_control.py index ee3de07c..686a4e1d 100644 --- a/hub/city_model_structure/building_demand/thermal_control.py +++ b/hub/city_model_structure/building_demand/thermal_control.py @@ -4,6 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2022 Concordia CERC group Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca """ +from math import inf from typing import Union, List from hub.city_model_structure.attributes.schedule import Schedule @@ -22,16 +23,14 @@ class ThermalControl: @staticmethod def _maximum_value(schedules): - maximum = -1000 + maximum = -inf for schedule in schedules: - for value in schedule.values: - if value > maximum: - maximum = value + maximum = max(maximum, max(schedule.values)) return maximum @staticmethod def _minimum_value(schedules): - minimum = 1000 + minimum = inf for schedule in schedules: minimum = min(minimum, min(schedule.values)) return minimum