Add windows as an attribute

This commit is contained in:
Alireza Adli 2024-07-18 12:02:10 -04:00
parent 455db4c522
commit 346bbf4bdf

View File

@ -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."""