From 9094c286c4a742e3a38ddfae54d0c83b193084cc Mon Sep 17 00:00:00 2001 From: sanam Date: Thu, 10 Aug 2023 10:04:59 -0400 Subject: [PATCH 1/9] new branch created --- .idea/.gitignore | 3 ++ .idea/hub.iml | 12 ++++++++ .idea/inspectionProfiles/Project_Default.xml | 30 +++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ .idea/misc.xml | 4 +++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ .../stochastic_occupancy_model/archetype.py | 8 +++++ 8 files changed, 77 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/hub.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/hub.iml b/.idea/hub.iml new file mode 100644 index 00000000..8b8c3954 --- /dev/null +++ b/.idea/hub.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..0c6593c6 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,30 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..ef318927 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..8d1428ff --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py new file mode 100644 index 00000000..86e895fe --- /dev/null +++ b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py @@ -0,0 +1,8 @@ +""" +Energy System catalog archetype +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2023 Concordia CERC group +Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca +""" + +import \ No newline at end of file From 02a03b8239b7ea44f6c98374de7fff189c6ddbd7 Mon Sep 17 00:00:00 2001 From: sanam Date: Thu, 10 Aug 2023 11:23:23 -0400 Subject: [PATCH 2/9] new directory created --- .../data_models/stochastic_occupancy_model/archetype.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py deleted file mode 100644 index 86e895fe..00000000 --- a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py +++ /dev/null @@ -1,8 +0,0 @@ -""" -Energy System catalog archetype -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2023 Concordia CERC group -Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" - -import \ No newline at end of file From e1ca39950fef287e875c4d4ea66acba0bcdf7e55 Mon Sep 17 00:00:00 2001 From: sanam Date: Thu, 10 Aug 2023 11:25:40 -0400 Subject: [PATCH 3/9] new directory created --- .../stochastic_occupancy_model/archetype.py | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py new file mode 100644 index 00000000..3397c4bf --- /dev/null +++ b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py @@ -0,0 +1,155 @@ +""" +Construction catalog Archetype +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2022 Concordia CERC group +Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +""" + +from hub.catalog_factories.data_models.construction.construction import Construction + + +class Archetype: + """ + Archetype class + """ + def __init__(self, archetype_id, + name, + function, + climate_zone, + construction_period, + constructions, + average_storey_height, + thermal_capacity, + extra_loses_due_to_thermal_bridges, + indirect_heated_ratio, + infiltration_rate_for_ventilation_system_off, + infiltration_rate_for_ventilation_system_on): + self._id = archetype_id + self._name = name + self._function = function + self._climate_zone = climate_zone + self._construction_period = construction_period + self._constructions = constructions + self._average_storey_height = average_storey_height + self._thermal_capacity = thermal_capacity + self._extra_loses_due_to_thermal_bridges = extra_loses_due_to_thermal_bridges + self._indirect_heated_ratio = indirect_heated_ratio + self._infiltration_rate_for_ventilation_system_off = infiltration_rate_for_ventilation_system_off + self._infiltration_rate_for_ventilation_system_on = infiltration_rate_for_ventilation_system_on + + @property + def id(self): + """ + Get archetype id + :return: str + """ + return self._id + + @property + def name(self): + """ + Get archetype name + :return: str + """ + return self._name + + @property + def function(self): + """ + Get archetype function + :return: str + """ + return self._function + + @property + def climate_zone(self): + """ + Get archetype climate zone + :return: str + """ + return self._climate_zone + + @property + def constructions(self) -> [Construction]: + """ + Get archetype constructions + :return: [Construction] + """ + return self._constructions + + @property + def construction_period(self): + """ + Get archetype construction period + :return: str + """ + return self._construction_period + + @property + def average_storey_height(self): + """ + Get archetype average storey height in m + :return: float + """ + return self._average_storey_height + + @property + def thermal_capacity(self): + """ + Get archetype thermal capacity in J/m3K + :return: float + """ + return self._thermal_capacity + + @property + def extra_loses_due_to_thermal_bridges(self): + """ + Get archetype extra loses due to thermal bridges in W/m2K + :return: float + """ + return self._extra_loses_due_to_thermal_bridges + + @property + def indirect_heated_ratio(self): + """ + Get archetype indirect heated area ratio + :return: float + """ + return self._indirect_heated_ratio + + @property + def infiltration_rate_for_ventilation_system_off(self): + """ + Get archetype infiltration rate for ventilation system off in 1/s + :return: float + """ + return self._infiltration_rate_for_ventilation_system_off + + @property + def infiltration_rate_for_ventilation_system_on(self): + """ + Get archetype infiltration rate for ventilation system on in 1/s + :return: float + """ + return self._infiltration_rate_for_ventilation_system_on + + def to_dictionary(self): + """Class content to dictionary""" + _constructions = [] + for _construction in self.constructions: + _constructions.append(_construction.to_dictionary()) + content = {'Archetype': {'id': self.id, + 'name': self.name, + 'function': self.function, + 'climate zone': self.climate_zone, + 'period of construction': self.construction_period, + 'average storey height [m]': self.average_storey_height, + 'thermal capacity [J/m3K]': self.thermal_capacity, + 'extra loses due to thermal bridges [W/m2K]': self.extra_loses_due_to_thermal_bridges, + 'indirect heated ratio': self.indirect_heated_ratio, + 'infiltration rate for ventilation off [1/s]': self.infiltration_rate_for_ventilation_system_off, + 'infiltration rate for ventilation on [1/s]': self.infiltration_rate_for_ventilation_system_on, + 'constructions': _constructions + } + } + return content From a3028221e32f8c78ff38e0235bd2629e7dd7776c Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Fri, 11 Aug 2023 10:17:02 -0400 Subject: [PATCH 4/9] added .gitignore to always ignore .idea --- .idea/.gitignore => .gitignore | 3 +- .idea/hub.iml | 12 -------- .idea/inspectionProfiles/Project_Default.xml | 30 ------------------- .../inspectionProfiles/profiles_settings.xml | 6 ---- .idea/misc.xml | 4 --- .idea/modules.xml | 8 ----- .idea/vcs.xml | 6 ---- 7 files changed, 1 insertion(+), 68 deletions(-) rename .idea/.gitignore => .gitignore (51%) delete mode 100644 .idea/hub.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.gitignore similarity index 51% rename from .idea/.gitignore rename to .gitignore index 26d33521..fd31855a 100644 --- a/.idea/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ # Default ignored files -/shelf/ -/workspace.xml +.idea \ No newline at end of file diff --git a/.idea/hub.iml b/.idea/hub.iml deleted file mode 100644 index 8b8c3954..00000000 --- a/.idea/hub.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 0c6593c6..00000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2da..00000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index ef318927..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 8d1428ff..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 482c06e4c27b9a94c490476115826f13690143bc Mon Sep 17 00:00:00 2001 From: sanam Date: Wed, 20 Sep 2023 11:30:41 -0400 Subject: [PATCH 5/9] new class created --- .../stochastic_occupancy_model/archetype.py | 105 +++--------------- .../data_models/usages/lighting.py | 2 +- 2 files changed, 15 insertions(+), 92 deletions(-) diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py index 3397c4bf..71d597d1 100644 --- a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py +++ b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py @@ -1,11 +1,10 @@ """ -Construction catalog Archetype +Stochastic_occupancy catalog Archetype SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2022 Concordia CERC group -Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca """ -from hub.catalog_factories.data_models.construction.construction import Construction class Archetype: @@ -15,27 +14,14 @@ class Archetype: def __init__(self, archetype_id, name, function, - climate_zone, - construction_period, - constructions, - average_storey_height, - thermal_capacity, - extra_loses_due_to_thermal_bridges, - indirect_heated_ratio, - infiltration_rate_for_ventilation_system_off, - infiltration_rate_for_ventilation_system_on): + climate_zone, stochastic_schedule + ): self._id = archetype_id self._name = name self._function = function self._climate_zone = climate_zone - self._construction_period = construction_period - self._constructions = constructions - self._average_storey_height = average_storey_height - self._thermal_capacity = thermal_capacity - self._extra_loses_due_to_thermal_bridges = extra_loses_due_to_thermal_bridges - self._indirect_heated_ratio = indirect_heated_ratio - self._infiltration_rate_for_ventilation_system_off = infiltration_rate_for_ventilation_system_off - self._infiltration_rate_for_ventilation_system_on = infiltration_rate_for_ventilation_system_on + self._stochastic_schedule + @property def id(self): @@ -70,86 +56,23 @@ class Archetype: return self._climate_zone @property - def constructions(self) -> [Construction]: + def stchastic_schedule(self): """ - Get archetype constructions - :return: [Construction] + Get stochastic schedules from the code + :return: schedule """ - return self._constructions - - @property - def construction_period(self): - """ - Get archetype construction period - :return: str - """ - return self._construction_period - - @property - def average_storey_height(self): - """ - Get archetype average storey height in m - :return: float - """ - return self._average_storey_height - - @property - def thermal_capacity(self): - """ - Get archetype thermal capacity in J/m3K - :return: float - """ - return self._thermal_capacity - - @property - def extra_loses_due_to_thermal_bridges(self): - """ - Get archetype extra loses due to thermal bridges in W/m2K - :return: float - """ - return self._extra_loses_due_to_thermal_bridges - - @property - def indirect_heated_ratio(self): - """ - Get archetype indirect heated area ratio - :return: float - """ - return self._indirect_heated_ratio - - @property - def infiltration_rate_for_ventilation_system_off(self): - """ - Get archetype infiltration rate for ventilation system off in 1/s - :return: float - """ - return self._infiltration_rate_for_ventilation_system_off - - @property - def infiltration_rate_for_ventilation_system_on(self): - """ - Get archetype infiltration rate for ventilation system on in 1/s - :return: float - """ - return self._infiltration_rate_for_ventilation_system_on + return self._stochastic_schedule def to_dictionary(self): """Class content to dictionary""" - _constructions = [] - for _construction in self.constructions: - _constructions.append(_construction.to_dictionary()) + _stochastic_schedule = [] + for _stochastic_schedule in self.stochastic_schedule: + _stochastic_schedule.append(_stochastic_schedule.to_dictionary()) content = {'Archetype': {'id': self.id, 'name': self.name, 'function': self.function, 'climate zone': self.climate_zone, - 'period of construction': self.construction_period, - 'average storey height [m]': self.average_storey_height, - 'thermal capacity [J/m3K]': self.thermal_capacity, - 'extra loses due to thermal bridges [W/m2K]': self.extra_loses_due_to_thermal_bridges, - 'indirect heated ratio': self.indirect_heated_ratio, - 'infiltration rate for ventilation off [1/s]': self.infiltration_rate_for_ventilation_system_off, - 'infiltration rate for ventilation on [1/s]': self.infiltration_rate_for_ventilation_system_on, - 'constructions': _constructions + 'stochastic_schedule': self.stochastic_schedule } } return content diff --git a/hub/catalog_factories/data_models/usages/lighting.py b/hub/catalog_factories/data_models/usages/lighting.py index 2d9420fe..fafd5ab1 100644 --- a/hub/catalog_factories/data_models/usages/lighting.py +++ b/hub/catalog_factories/data_models/usages/lighting.py @@ -54,7 +54,7 @@ class Lighting: return self._latent_fraction @property - def schedules(self) -> Union[None, List[Schedule]]: + def schedules(self) -> Union[None, List[Schedule], List[Stochastic_Schedule]]: """ Get schedules dataType = fraction From bf004f9e18c8a3a437a9b762593a24863cb02f89 Mon Sep 17 00:00:00 2001 From: sanam Date: Thu, 21 Sep 2023 14:33:13 -0400 Subject: [PATCH 6/9] Stochastic schedule folder created --- .../stochastic_occupancy_model/stochastic_schedule | 0 .../stochastic_occupancy_model/stochastic_schedule.py | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule create mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule b/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule new file mode 100644 index 00000000..e69de29b diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py new file mode 100644 index 00000000..23e6ea23 --- /dev/null +++ b/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py @@ -0,0 +1,7 @@ +""" +Stochastic_occupancy catalog stochastic schedules +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2022 Concordia CERC group +Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca +""" + From 12d20f2d7a6ca7c706c14b45b79d07e1205857fa Mon Sep 17 00:00:00 2001 From: sanam Date: Fri, 22 Sep 2023 09:42:10 -0400 Subject: [PATCH 7/9] Stochastic schedule folder created --- .../stochastic_schedule.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py index 23e6ea23..6df529a0 100644 --- a/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py +++ b/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py @@ -5,3 +5,15 @@ Copyright © 2022 Concordia CERC group Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca """ +class StochasticSchedules: + """ + Schedule class + """ + + def __init__(self, schedule_type, values, data_type, time_step, time_range, day_types): + self._type = schedule_type + self._values = values + self._data_type = data_type + self._time_step = time_step + self._time_range = time_range + self._day_types = day_types \ No newline at end of file From 4ce9f99e4d1bc32087af246026cd0cd3bea5cfcd Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Mon, 25 Sep 2023 03:41:52 -0400 Subject: [PATCH 8/9] cleaning mix-branches --- .../stochastic_occupancy_model/archetype.py | 78 ------------------- .../stochastic_schedule | 0 .../stochastic_schedule.py | 19 ----- .../data_models/usages/lighting.py | 2 +- 4 files changed, 1 insertion(+), 98 deletions(-) delete mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py delete mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule delete mode 100644 hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py deleted file mode 100644 index 71d597d1..00000000 --- a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -Stochastic_occupancy catalog Archetype -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2022 Concordia CERC group -Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" - - - -class Archetype: - """ - Archetype class - """ - def __init__(self, archetype_id, - name, - function, - climate_zone, stochastic_schedule - ): - self._id = archetype_id - self._name = name - self._function = function - self._climate_zone = climate_zone - self._stochastic_schedule - - - @property - def id(self): - """ - Get archetype id - :return: str - """ - return self._id - - @property - def name(self): - """ - Get archetype name - :return: str - """ - return self._name - - @property - def function(self): - """ - Get archetype function - :return: str - """ - return self._function - - @property - def climate_zone(self): - """ - Get archetype climate zone - :return: str - """ - return self._climate_zone - - @property - def stchastic_schedule(self): - """ - Get stochastic schedules from the code - :return: schedule - """ - return self._stochastic_schedule - - def to_dictionary(self): - """Class content to dictionary""" - _stochastic_schedule = [] - for _stochastic_schedule in self.stochastic_schedule: - _stochastic_schedule.append(_stochastic_schedule.to_dictionary()) - content = {'Archetype': {'id': self.id, - 'name': self.name, - 'function': self.function, - 'climate zone': self.climate_zone, - 'stochastic_schedule': self.stochastic_schedule - } - } - return content diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule b/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule deleted file mode 100644 index e69de29b..00000000 diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py deleted file mode 100644 index 6df529a0..00000000 --- a/hub/catalog_factories/data_models/stochastic_occupancy_model/stochastic_schedule.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -Stochastic_occupancy catalog stochastic schedules -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2022 Concordia CERC group -Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" - -class StochasticSchedules: - """ - Schedule class - """ - - def __init__(self, schedule_type, values, data_type, time_step, time_range, day_types): - self._type = schedule_type - self._values = values - self._data_type = data_type - self._time_step = time_step - self._time_range = time_range - self._day_types = day_types \ No newline at end of file diff --git a/hub/catalog_factories/data_models/usages/lighting.py b/hub/catalog_factories/data_models/usages/lighting.py index fafd5ab1..2d9420fe 100644 --- a/hub/catalog_factories/data_models/usages/lighting.py +++ b/hub/catalog_factories/data_models/usages/lighting.py @@ -54,7 +54,7 @@ class Lighting: return self._latent_fraction @property - def schedules(self) -> Union[None, List[Schedule], List[Stochastic_Schedule]]: + def schedules(self) -> Union[None, List[Schedule]]: """ Get schedules dataType = fraction From 8b66e20e9ae23d6e67bf630f0dd23e550d9ec249 Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Wed, 27 Sep 2023 05:35:28 -0400 Subject: [PATCH 9/9] some refactoring --- hub/exports/building_energy/idf.py | 1 + ...ergy_plus_workflow.py => energy_plus_single_building.py} | 6 ++---- hub/imports/results_factory.py | 6 +++--- tests/test_results_import.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) rename hub/imports/results/{energy_plus_workflow.py => energy_plus_single_building.py} (94%) diff --git a/hub/exports/building_energy/idf.py b/hub/exports/building_energy/idf.py index 50f97849..63ea0b19 100644 --- a/hub/exports/building_energy/idf.py +++ b/hub/exports/building_energy/idf.py @@ -558,6 +558,7 @@ class Idf: self._add_lighting(thermal_zone, building.name) self._add_appliances(thermal_zone, building.name) self._add_dhw(thermal_zone, building.name) + # todo: @Guille: if export_type is not surfaces, we don't differentiate between shadows and buildings? if self._export_type == "Surfaces": if building.name in self._target_buildings or building.name in self._adjacent_buildings: if building.thermal_zones_from_internal_zones is not None: diff --git a/hub/imports/results/energy_plus_workflow.py b/hub/imports/results/energy_plus_single_building.py similarity index 94% rename from hub/imports/results/energy_plus_workflow.py rename to hub/imports/results/energy_plus_single_building.py index 627b3fd7..a5e0fd08 100644 --- a/hub/imports/results/energy_plus_workflow.py +++ b/hub/imports/results/energy_plus_single_building.py @@ -12,7 +12,7 @@ import csv import hub.helpers.constants as cte -class EnergyPlusWorkflow: +class EnergyPlusSingleBuilding: def __init__(self, city, base_path): self._city = city self._base_path = base_path @@ -59,7 +59,7 @@ class EnergyPlusWorkflow: total_cooling_demand += float(line[cooling_index]) building_energy_demands['Cooling (J)'].append(total_cooling_demand) for dhw_index in dhw_column_index: - total_dhw_demand += float(line[dhw_index]) * 3600 + total_dhw_demand += float(line[dhw_index]) * cte.WATTS_HOUR_TO_JULES building_energy_demands['DHW (J)'].append(total_dhw_demand) for appliance_index in appliance_column_index: total_appliance_demand += float(line[appliance_index]) @@ -85,8 +85,6 @@ class EnergyPlusWorkflow: building.domestic_hot_water_heat_demand[cte.HOUR] = building_energy_demands['DHW (J)'] building.appliances_electrical_demand[cte.HOUR] = building_energy_demands['Appliances (J)'] building.lighting_electrical_demand[cte.HOUR] = building_energy_demands['Lighting (J)'] - # todo: @Saeed, this a list of ONE value with the total energy of the year, exactly the same as cte.YEAR. - # You have to use the method to add hourly values from helpers/monthly_values building.heating_demand[cte.MONTH] = MonthlyValues.get_total_month(building.heating_demand[cte.HOUR]) building.cooling_demand[cte.MONTH] = MonthlyValues.get_total_month(building.cooling_demand[cte.HOUR]) building.domestic_hot_water_heat_demand[cte.MONTH] = ( diff --git a/hub/imports/results_factory.py b/hub/imports/results_factory.py index fac60de3..480b5c64 100644 --- a/hub/imports/results_factory.py +++ b/hub/imports/results_factory.py @@ -10,7 +10,7 @@ from pathlib import Path from hub.helpers.utils import validate_import_export_type from hub.imports.results.insel_monthly_energry_balance import InselMonthlyEnergyBalance from hub.imports.results.simplified_radiosity_algorithm import SimplifiedRadiosityAlgorithm -from hub.imports.results.energy_plus_workflow import EnergyPlusWorkflow +from hub.imports.results.energy_plus_single_building import EnergyPlusSingleBuilding class ResultFactory: """ @@ -46,11 +46,11 @@ class ResultFactory: """ InselMonthlyEnergyBalance(self._city, self._base_path).enrich() - def _energy_plus_workflow(self): + def _energy_plus_single_building(self): """ Enrich the city with energy plus results """ - EnergyPlusWorkflow(self._city, self._base_path).enrich() + EnergyPlusSingleBuilding(self._city, self._base_path).enrich() def enrich(self): """ diff --git a/tests/test_results_import.py b/tests/test_results_import.py index 8f4e0aed..b83418e6 100644 --- a/tests/test_results_import.py +++ b/tests/test_results_import.py @@ -94,7 +94,7 @@ class TestResultsImport(TestCase): self.assertIsNotNone(building.cooling_peak_load) def test_energy_plus_results_import(self): - ResultFactory('energy_plus_workflow', self._city, self._example_path).enrich() + ResultFactory('energy_plus_single_building', self._city, self._example_path).enrich() for building in self._city.buildings: csv_output_name = f'{building.name}_out.csv' csv_output_path = (self._example_path / csv_output_name).resolve()