From 7101a8d6354516f8b108545b48ece9f33c470675 Mon Sep 17 00:00:00 2001 From: Pilar Date: Tue, 31 Aug 2021 16:16:22 -0400 Subject: [PATCH] some reorganization of files to clarify the processes --- helpers/enrich_city.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/helpers/enrich_city.py b/helpers/enrich_city.py index 11d651e1..e19bcf41 100644 --- a/helpers/enrich_city.py +++ b/helpers/enrich_city.py @@ -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.