Ensure year of construction field is always an int

This commit is contained in:
Guille Gutierrez 2023-03-27 12:37:31 -04:00
parent 6c8fc2ba9e
commit 0a8c1c3c42
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ class NrcanPhysicsParameters:
nrcan_archetypes = nrcan_catalog.entries('archetypes')
for building_archetype in nrcan_archetypes:
construction_period_limits = building_archetype.construction_period.split('_')
if int(construction_period_limits[0]) <= year_of_construction <= int(construction_period_limits[1]):
if int(construction_period_limits[0]) <= int(year_of_construction) <= int(construction_period_limits[1]):
if (str(function) == str(building_archetype.function)) and \
(climate_zone == str(building_archetype.climate_zone)):
return building_archetype

View File

@ -78,7 +78,7 @@ class NrelPhysicsParameters:
construction_period_limits = building_archetype.construction_period.split(' - ')
if construction_period_limits[1] == 'PRESENT':
construction_period_limits[1] = 3000
if int(construction_period_limits[0]) <= year_of_construction < int(construction_period_limits[1]):
if int(construction_period_limits[0]) <= int(year_of_construction) < int(construction_period_limits[1]):
if (str(function) == str(building_archetype.function)) and \
(climate_zone == str(building_archetype.climate_zone)):
return building_archetype