diff --git a/hub/city_model_structure/life_cycle_assessment/access_nrcan_catalogue.py b/hub/city_model_structure/life_cycle_assessment/access_nrcan_catalogue.py index 3340d9f2..af179b0d 100644 --- a/hub/city_model_structure/life_cycle_assessment/access_nrcan_catalogue.py +++ b/hub/city_model_structure/life_cycle_assessment/access_nrcan_catalogue.py @@ -9,6 +9,9 @@ Code contributors: Alireza Adli alireza.adli@concordia.ca import json from pathlib import Path +from hub.helpers.data.hub_function_to_nrcan_construction_function \ + import HubFunctionToNrcanConstructionFunction + class AccessNrcanCatalog: """ @@ -21,6 +24,7 @@ class AccessNrcanCatalog: self._path = Path(path) self.archetypes = archetypes self.constructions = constructions + self.hub_to_nrcan_dictionary = HubFunctionToNrcanConstructionFunction().dictionary @property def archetypes(self): @@ -40,8 +44,12 @@ class AccessNrcanCatalog: constructions_path = (self._path / constructions).resolve() self._constructions = json.loads(constructions_path.read_text()) + def hub_to_nrcan_function(self, hub_function): + return self.hub_to_nrcan_dictionary[hub_function] + @staticmethod def year_to_period_of_construction(year_of_construction): + period_of_construction = None if 1000 <= year_of_construction <= 1900: period_of_construction = '1000_1900' elif 1901 <= year_of_construction <= 1910: