diff --git a/helpers/yearly_from_daily_schedules.py b/helpers/yearly_from_daily_schedules.py index 9c8431c9..c7c3bac5 100644 --- a/helpers/yearly_from_daily_schedules.py +++ b/helpers/yearly_from_daily_schedules.py @@ -32,7 +32,7 @@ class YearlyFromDailySchedules: values = [] for month in range(1, 13): - for day in range(1, cal._monthlen(self._year, month)+1): + for day in range(1, cal.monthlen(self._year, month)+1): week_day = cal.weekday(self._year, month, day) values.extend(weekly_schedules[week_day]) yearly_schedule.type = self._daily_schedules[0].type diff --git a/unittests/test_usage_factory.py b/unittests/test_usage_factory.py index e3c6b7ba..111e581f 100644 --- a/unittests/test_usage_factory.py +++ b/unittests/test_usage_factory.py @@ -7,6 +7,7 @@ from pathlib import Path from unittest import TestCase from imports.geometry_factory import GeometryFactory +from imports.construction_factory import ConstructionFactory from imports.usage_factory import UsageFactory from imports.construction_factory import ConstructionFactory from imports.geometry.helpers.geometry_helper import GeometryHelper @@ -29,6 +30,15 @@ class TestUsageFactory(TestCase): self.assertIsNotNone(_city, 'city is none') return _city + def test_comnet(self): + file = 'pluto_building.gml' + city = self._get_citygml(file) + for building in city.buildings: + building.function = GeometryHelper.pluto_to_function[building.function] + + ConstructionFactory('nrel', city).enrich() + UsageFactory('comnet', city).enrich() + def test_city_with_usage(self): """ Enrich the city with the usage information and verify it