From e3acabeb7468b44bac3347534422a27aeb1e58dd Mon Sep 17 00:00:00 2001 From: Pilar Date: Wed, 8 Jun 2022 16:22:12 -0400 Subject: [PATCH] fixing bug in test_enrichment.py --- city_model_structure/building_demand/thermal_zone.py | 2 +- imports/usage/comnet_usage_parameters.py | 2 +- unittests/test_enrichement.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/city_model_structure/building_demand/thermal_zone.py b/city_model_structure/building_demand/thermal_zone.py index 2d08fbe7..b8074f94 100644 --- a/city_model_structure/building_demand/thermal_zone.py +++ b/city_model_structure/building_demand/thermal_zone.py @@ -467,7 +467,7 @@ class ThermalZone: _base_schedule.time_step = cte.HOUR _base_schedule.data_type = cte.ANY_NUMBER _schedules_defined = True - values = numpy.zeros(24, 8) + values = numpy.zeros([24, 8]) for usage_zone in self.usage_zones: for internal_gain in usage_zone.internal_gains: _average_internal_gain += internal_gain.average_internal_gain * usage_zone.percentage diff --git a/imports/usage/comnet_usage_parameters.py b/imports/usage/comnet_usage_parameters.py index 87eae088..8ad563f9 100644 --- a/imports/usage/comnet_usage_parameters.py +++ b/imports/usage/comnet_usage_parameters.py @@ -298,7 +298,7 @@ class ComnetUsageParameters: _radiative_heat_gain = archetype.occupancy.sensible_radiative_internal_gain _total_heat_gain = (_latent_heat_gain + _convective_heat_gain + _radiative_heat_gain) - _schedule_values = numpy.zeros(24, 7) + _schedule_values = numpy.zeros([24, 8]) _sum = 0 for day, _schedule in enumerate(archetype.occupancy.schedules): for v, value in enumerate(_schedule.values): diff --git a/unittests/test_enrichement.py b/unittests/test_enrichement.py index b7af6df5..23a54027 100644 --- a/unittests/test_enrichement.py +++ b/unittests/test_enrichement.py @@ -60,7 +60,7 @@ class TestGeometryFactory(TestCase): self.assertIsNotNone(thermal_zone.days_year, 'thermal_zone days a year is none') self.assertIsNotNone(thermal_zone.occupancy, 'thermal_zone occupancy is none') self.assertIsNotNone(thermal_zone.thermal_control, 'thermal_zone thermal control is none') - self.assertIsNotNone(thermal_zone.get_internal_gains(), 'thermal_zone internal gains returns none') + self.assertIsNotNone(thermal_zone.internal_gains, 'thermal_zone internal gains returns none') def _check_extra_thermal_zone(self, thermal_zone): self.assertIsNotNone(thermal_zone.lighting, 'thermal_zone lighting is none')