From 346bbf4bdf5fcebd21d3ab8545012da1ba73f07d Mon Sep 17 00:00:00 2001 From: Alireza Adli Date: Thu, 18 Jul 2024 12:02:10 -0400 Subject: [PATCH] Add windows as an attribute --- .../access_nrcan_catalogue.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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 af179b0d..0fc76705 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 @@ -20,10 +20,12 @@ class AccessNrcanCatalog: def __init__( self, path, archetypes='nrcan_archetypes.json', - constructions='nrcan_constructions_cap_3.json'): + constructions='nrcan_constructions_cap_3.json', + transparent_surfaces='nrcan_transparent_surfaces_dictionaries.json'): self._path = Path(path) self.archetypes = archetypes self.constructions = constructions + self.transparent_surfaces = transparent_surfaces self.hub_to_nrcan_dictionary = HubFunctionToNrcanConstructionFunction().dictionary @property @@ -44,6 +46,16 @@ class AccessNrcanCatalog: constructions_path = (self._path / constructions).resolve() self._constructions = json.loads(constructions_path.read_text()) + @property + def transparent_surfaces(self): + return self._transparent_surfaces + + @transparent_surfaces.setter + def transparent_surfaces(self, transparent_surfaces): + transparent_surfaces_path = (self._path / transparent_surfaces).resolve() + self._transparent_surfaces = json.loads( + transparent_surfaces_path.read_text()) + def hub_to_nrcan_function(self, hub_function): return self.hub_to_nrcan_dictionary[hub_function] @@ -90,8 +102,9 @@ class AccessNrcanCatalog: elif opaque_surface[opaque_surface_key]['type'] == component_type: return opaque_surface[opaque_surface_key]['layers'] - def nrcan_windows(self, window_code): - return self._constructions['transparent_surfaces'][0][window_code] + @staticmethod + def nrcan_windows_skylight(opaque_surface_code): + return self.constructions['transparent_surfaces'][0][window_code] def find_opaque_surface(self, function, period_of_construction, climate_zone): """Returns the opaque_surface_name corresponding to the given arguments."""