some reorganization of files to clarify the processes

This commit is contained in:
Pilar 2021-08-31 16:16:22 -04:00
parent ad696bc8b6
commit 7101a8d635

View File

@ -26,7 +26,8 @@ class EnrichCity:
"""
return self._errors
def enriched_city(self, construction_format=None, usage_format=None, schedules_format=None):
def enriched_city(self, construction_format=None, usage_format=None, schedules_format=None,
pickle_construction=False, pickle_usage=False, pickle_schedules=False):
"""
Enrich the city with the given formats
:return: City
@ -34,25 +35,25 @@ class EnrichCity:
if self._enriched_city is None:
self._errors = []
print('original:', len(self._city.buildings))
if construction_format is not None:
self._enriched_city = self._construction(construction_format)
if len(self._errors) != 0:
return self._enriched_city
if usage_format is not None:
self._enriched_city = self._usage(usage_format)
if len(self._errors) != 0:
return self._enriched_city
if schedules_format is not None:
self._enriched_city = self._schedules(schedules_format)
if len(self._errors) != 0:
return self._enriched_city
if not pickle_construction:
if construction_format is not None:
self._enriched_city = self._construction(construction_format)
if len(self._errors) != 0:
return self._enriched_city
if not pickle_usage:
if usage_format is not None:
self._enriched_city = self._usage(usage_format)
if len(self._errors) != 0:
return self._enriched_city
if not pickle_schedules:
if schedules_format is not None:
self._enriched_city = self._schedules(schedules_format)
if len(self._errors) != 0:
return self._enriched_city
self._enriched_city = self._city
return self._enriched_city
def _construction(self, construction_format):
# todo: in construction factory, when adding the values to the thermal zones,
# these are created using the just read storeys_above_ground -> review where to assign this value!!
ConstructionFactory(construction_format, self._city).enrich()
for building in self._city.buildings:
# infiltration_rate_system_off is a mandatory parameter.