From 8099037225ce991a496ad8645b5890cd84ed83bf Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Mon, 25 Sep 2023 03:34:57 -0400 Subject: [PATCH] prints to check error --- hub/city_model_structure/building.py | 3 ++- tests/test_results_import.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hub/city_model_structure/building.py b/hub/city_model_structure/building.py index 8d8b5ea3..fd027b1b 100644 --- a/hub/city_model_structure/building.py +++ b/hub/city_model_structure/building.py @@ -681,6 +681,7 @@ class Building(CityObject): for i, value in enumerate(item): _working_hours[key][i] = max(_working_hours[key][i], saved_values[i]) + print(_working_hours) _total_hours = 0 for key in _working_hours: hours = sum(_working_hours[key]) @@ -735,7 +736,7 @@ class Building(CityObject): for key, item in self._distribution_systems_electrical_consumption.items(): for i in range(0, len(item)): self._distribution_systems_electrical_consumption[key][i] += _peak_load * _consumption_fix_flow \ - * _working_hours + * _working_hours[key] * cte.WATTS_HOUR_TO_JULES return self._distribution_systems_electrical_consumption def _calculate_consumption(self, consumption_type, demand): diff --git a/tests/test_results_import.py b/tests/test_results_import.py index 1befac19..562abfa9 100644 --- a/tests/test_results_import.py +++ b/tests/test_results_import.py @@ -40,7 +40,7 @@ class TestResultsImport(TestCase): function_to_hub=Dictionaries().montreal_function_to_hub_function).city ConstructionFactory('nrcan', self._city).enrich() - UsageFactory('nrcan', self._city).enrich() + UsageFactory('comnet', self._city).enrich() def test_sra_import(self): ExportsFactory('sra', self._city, self._output_path).export() @@ -64,6 +64,7 @@ class TestResultsImport(TestCase): ResultFactory('insel_monthly_energy_balance', self._city, self._output_path).enrich() # Check that all the buildings have heating and cooling values for building in self._city.buildings: + a = building.distribution_systems_electrical_consumption self.assertIsNotNone(building.heating_demand[cte.MONTH]) self.assertIsNotNone(building.cooling_demand[cte.MONTH]) self.assertIsNotNone(building.heating_demand[cte.YEAR])