From d67c5c438b58c2075470969615061785503f67d3 Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Wed, 7 Jun 2023 14:40:44 -0400 Subject: [PATCH] solved bug in _calculate_working_hours --- hub/city_model_structure/building.py | 8 ++++---- hub/exports/exports_factory.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hub/city_model_structure/building.py b/hub/city_model_structure/building.py index 8111bb5e..df7ca93f 100644 --- a/hub/city_model_structure/building.py +++ b/hub/city_model_structure/building.py @@ -608,16 +608,16 @@ class Building(CityObject): for i, value in enumerate(schedule.values): if value > 0: _working_hours_per_schedule[i] = 1 - for day_type in schedule.day_types: - _working_hours_per_thermal_zone[day_type] = _working_hours_per_schedule + for day_type in schedule.day_types: + _working_hours_per_thermal_zone[day_type] = _working_hours_per_schedule if len(_working_hours) == 0: _working_hours = _working_hours_per_thermal_zone else: for key, item in _working_hours.items(): saved_values = _working_hours_per_thermal_zone[key] for i, value in enumerate(item): - if saved_values[i] == 1: - value = 1 + _working_hours[key][i] = max(_working_hours[key][i], saved_values[i]) + _total_hours = 0 for key in _working_hours: hours = sum(_working_hours[key]) diff --git a/hub/exports/exports_factory.py b/hub/exports/exports_factory.py index 088edb5e..4b7216ea 100644 --- a/hub/exports/exports_factory.py +++ b/hub/exports/exports_factory.py @@ -17,7 +17,7 @@ class ExportsFactory: """ Exports factory class """ - def __init__(self, handler, city, path,target_buildings=None,adjacent_buildings=None): + def __init__(self, handler, city, path, target_buildings=None, adjacent_buildings=None): self._city = city self._handler = '_' + handler.lower() validate_import_export_type(ExportsFactory, handler)