solved bug in _calculate_working_hours
This commit is contained in:
parent
c6852e5af6
commit
d67c5c438b
|
@ -608,16 +608,16 @@ class Building(CityObject):
|
||||||
for i, value in enumerate(schedule.values):
|
for i, value in enumerate(schedule.values):
|
||||||
if value > 0:
|
if value > 0:
|
||||||
_working_hours_per_schedule[i] = 1
|
_working_hours_per_schedule[i] = 1
|
||||||
for day_type in schedule.day_types:
|
for day_type in schedule.day_types:
|
||||||
_working_hours_per_thermal_zone[day_type] = _working_hours_per_schedule
|
_working_hours_per_thermal_zone[day_type] = _working_hours_per_schedule
|
||||||
if len(_working_hours) == 0:
|
if len(_working_hours) == 0:
|
||||||
_working_hours = _working_hours_per_thermal_zone
|
_working_hours = _working_hours_per_thermal_zone
|
||||||
else:
|
else:
|
||||||
for key, item in _working_hours.items():
|
for key, item in _working_hours.items():
|
||||||
saved_values = _working_hours_per_thermal_zone[key]
|
saved_values = _working_hours_per_thermal_zone[key]
|
||||||
for i, value in enumerate(item):
|
for i, value in enumerate(item):
|
||||||
if saved_values[i] == 1:
|
_working_hours[key][i] = max(_working_hours[key][i], saved_values[i])
|
||||||
value = 1
|
|
||||||
_total_hours = 0
|
_total_hours = 0
|
||||||
for key in _working_hours:
|
for key in _working_hours:
|
||||||
hours = sum(_working_hours[key])
|
hours = sum(_working_hours[key])
|
||||||
|
|
|
@ -17,7 +17,7 @@ class ExportsFactory:
|
||||||
"""
|
"""
|
||||||
Exports factory class
|
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._city = city
|
||||||
self._handler = '_' + handler.lower()
|
self._handler = '_' + handler.lower()
|
||||||
validate_import_export_type(ExportsFactory, handler)
|
validate_import_export_type(ExportsFactory, handler)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user