From ec288f8db1332786bffa3f487f7269d4b019ef6c Mon Sep 17 00:00:00 2001 From: guille Date: Thu, 10 Aug 2023 12:25:23 -0400 Subject: [PATCH] rollback unwanted changes for unit test --- .../building_demand/thermal_control.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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