diff --git a/.gitignore b/.gitignore
index 10a17b31..64fa325d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@
/development_tests/
/data/energy_systems/heat_pumps/*.csv
/data/energy_systems/heat_pumps/*.insel
-.DS_Store
\ No newline at end of file
+.DS_Store
+__pycache__/
diff --git a/catalog_factories/catalog.py b/catalog_factories/catalog.py
index e7dc2eeb..96b61726 100644
--- a/catalog_factories/catalog.py
+++ b/catalog_factories/catalog.py
@@ -11,7 +11,6 @@ class Catalog:
Catalogs base class not implemented instance of the Catalog base class, catalog_factories will inherit from this class.
"""
- @property
def names(self, category=None):
"""
Base property to return the catalog entries names
diff --git a/catalog_factories/construction/construction_helpers.py b/catalog_factories/construction/construction_helpers.py
index 7ad3fd39..1d9e4bf4 100644
--- a/catalog_factories/construction/construction_helpers.py
+++ b/catalog_factories/construction/construction_helpers.py
@@ -21,6 +21,10 @@ nrel_to_function = {
'large hotel': cte.LARGE_HOTEL
}
+nrcan_to_function = {
+ 'residential': cte.RESIDENTIAL,
+}
+
reference_standard_to_construction_period = {
'ASHRAE 90.1_2004': '2004 - 2009',
'ASHRAE 189.1_2009': '2009 - PRESENT'
diff --git a/catalog_factories/construction/nrcan_catalog.py b/catalog_factories/construction/nrcan_catalog.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/catalog_factories/construction/nrel_catalog.py b/catalog_factories/construction/nrel_catalog.py
index 51e8a27b..3fc6a0d2 100644
--- a/catalog_factories/construction/nrel_catalog.py
+++ b/catalog_factories/construction/nrel_catalog.py
@@ -1,5 +1,5 @@
"""
-Greenery catalog
+Nrel construction catalog
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
@@ -14,7 +14,8 @@ from catalog_factories.data_models.construction.layer import Layer
from catalog_factories.data_models.construction.construction import Construction
from catalog_factories.data_models.construction.content import Content
from catalog_factories.data_models.construction.archetype import Archetype
-from catalog_factories.construction.construction_helpers import nrel_to_function, reference_standard_to_construction_period
+from catalog_factories.construction.construction_helpers import nrel_to_function
+from catalog_factories.construction.construction_helpers import reference_standard_to_construction_period
class NrelCatalog(Catalog):
@@ -22,41 +23,52 @@ class NrelCatalog(Catalog):
archetypes_path = str(Path(path / 'us_archetypes.xml').resolve())
constructions_path = str(Path(path / 'us_constructions.xml').resolve())
with open(constructions_path) as xml:
- self._constructions = xmltodict.parse(xml.read(), force_list=('material', 'window', 'construction'))
+ self._constructions = xmltodict.parse(xml.read(), force_list=('material', 'window', 'construction', 'layer'))
with open(archetypes_path) as xml:
self._archetypes = xmltodict.parse(xml.read(), force_list=('archetype', 'construction'))
- self._catalog_windows = []
- self._catalog_materials = []
- self._catalog_constructions = []
- self._catalog_archetypes = []
+ self._catalog_windows = self._load_windows()
+ self._catalog_materials = self._load_materials()
+ self._catalog_constructions = self._load_constructions()
+ self._catalog_archetypes = self._load_archetypes()
+ # store the full catalog data model in self._content
+ self._content = Content(self._catalog_archetypes,
+ self._catalog_constructions,
+ self._catalog_materials,
+ self._catalog_windows)
+
+ def _load_windows(self):
+ _catalog_windows = []
windows = self._constructions['library']['windows']['window']
for window in windows:
- frame_ratio = window['frame_ratio']
+ frame_ratio = window['frame_ratio']['#text']
g_value = window['shgc']
- overall_u_value = float(window['conductivity']) / float(window['thickness'])
- construction_name = window['@name']
- self._catalog_windows.append(Window(frame_ratio, g_value, overall_u_value, construction_name))
+ overall_u_value = float(window['conductivity']['#text']) / float(window['thickness']['#text'])
+ name = window['@name']
+ _catalog_windows.append(Window(frame_ratio, g_value, overall_u_value, name))
+ return _catalog_windows
+ def _load_materials(self):
+ _catalog_materials = []
materials = self._constructions['library']['materials']['material']
for material in materials:
material_id = material['@id']
name = material['@name']
- solar_absorptance = material['solar_absorptance']
- thermal_absorptance = material['thermal_absorptance']
- visible_absorptance = material['visible_absorptance']
+ solar_absorptance = material['solar_absorptance']['#text']
+ thermal_absorptance = material['thermal_absorptance']['#text']
+ visible_absorptance = material['visible_absorptance']['#text']
no_mass = True
thermal_resistance = None,
conductivity = None,
density = None,
specific_heat = None
- if material['no_mass'] == 'true':
+ if 'no_mass' in material and material['no_mass'] == 'true':
no_mass = True
- thermal_resistance = material['thermal_resistance']
+ thermal_resistance = material['thermal_resistance']['#text']
else:
- conductivity = material['conductivity']
- density = material['density']
- specific_heat = material['specific_heat']
+ conductivity = material['conductivity']['#text']
+ density = material['density']['#text']
+ specific_heat = material['specific_heat']['#text']
_material = Material(material_id,
name,
solar_absorptance,
@@ -67,8 +79,11 @@ class NrelCatalog(Catalog):
conductivity,
density,
specific_heat)
- self._catalog_materials.append(_material)
+ _catalog_materials.append(_material)
+ return _catalog_materials
+ def _load_constructions(self):
+ _catalog_constructions = []
constructions = self._constructions['library']['constructions']['construction']
for construction in constructions:
construction_id = construction['@id']
@@ -77,32 +92,37 @@ class NrelCatalog(Catalog):
layers = []
for layer in construction['layers']['layer']:
layer_id = layer['@id']
- name = layer['@name']
+ layer_name = layer['@name']
material_id = layer['material']
- thickness = layer['thickness']
- for material in self._materials:
+ thickness = 0
+ if 'thickness' in layer:
+ thickness = layer['thickness']['#text']
+ for material in self._catalog_materials:
if material_id == material.id:
- layers.append(Layer(layer_id, name, material, thickness))
+ layers.append(Layer(layer_id, layer_name, material, thickness))
break
- self._catalog_constructions.append(Construction(construction_id, construction_type, name, layers))
+ _catalog_constructions.append(Construction(construction_id, construction_type, name, layers))
+ return _catalog_constructions
+ def _load_archetypes(self):
+ _catalog_archetypes = []
archetypes = self._archetypes['archetypes']['archetype']
for archetype in archetypes:
archetype_id = archetype['@id']
function = nrel_to_function[archetype['@building_type']]
- construction_period = reference_standard_to_construction_period[archetype['reference_standard']]
- average_storey_height = archetype['average_storey_height']
- number_of_storeys = archetype['number_of_storeys']
- thermal_capacity = archetype['thermal_capacity']
- extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_to_thermal_bridges']
- indirect_heated_ratio = archetype['indirect_heated_ratio']
- infiltration_rate_for_ventilation_system_off = archetype['infiltration_rate_for_ventilation_system_off']
- infiltration_rate_for_ventilation_system_on = archetype['infiltration_rate_for_ventilation_system_on']
+ construction_period = reference_standard_to_construction_period[archetype['@reference_standard']]
+ average_storey_height = archetype['average_storey_height']['#text']
+ number_of_storeys = archetype['number_of_storeys']['#text']
+ thermal_capacity = archetype['thermal_capacity']['#text']
+ extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_to_thermal_bridges']['#text']
+ indirect_heated_ratio = archetype['indirect_heated_ratio']['#text']
+ infiltration_rate_for_ventilation_system_off = archetype['infiltration_rate_for_ventilation_system_off']['#text']
+ infiltration_rate_for_ventilation_system_on = archetype['infiltration_rate_for_ventilation_system_on']['#text']
archetype_constructions = []
for archetype_construction in archetype['constructions']['construction']:
- for construction in self._constructions:
+ for construction in self._catalog_constructions:
if construction.id == archetype_construction['@id']:
- window_ratio = archetype_construction['window_ratio']
+ window_ratio = archetype_construction['window_ratio']['#text']
window = archetype_construction['window']
_construction = Construction(construction.id,
construction.type,
@@ -111,25 +131,19 @@ class NrelCatalog(Catalog):
window_ratio,
window)
archetype_constructions.append(_construction)
- self._catalog_archetypes.append(Archetype(archetype_id,
- function,
- archetype_constructions,
- construction_period,
- average_storey_height,
- number_of_storeys,
- thermal_capacity,
- extra_loses_due_to_thermal_bridges,
- indirect_heated_ratio,
- infiltration_rate_for_ventilation_system_off,
- infiltration_rate_for_ventilation_system_on))
+ _catalog_archetypes.append(Archetype(archetype_id,
+ function,
+ archetype_constructions,
+ construction_period,
+ average_storey_height,
+ number_of_storeys,
+ thermal_capacity,
+ extra_loses_due_to_thermal_bridges,
+ indirect_heated_ratio,
+ infiltration_rate_for_ventilation_system_off,
+ infiltration_rate_for_ventilation_system_on))
+ return _catalog_archetypes
- # store the full catalog data model in self._content
- self._content = Content(self._catalog_archetypes,
- self._catalog_constructions,
- self._catalog_materials,
- self._catalog_windows)
-
- @property
def names(self, category=None):
"""
Get the catalog elements names
@@ -200,4 +214,3 @@ class NrelCatalog(Catalog):
if entry.name.lower() == name.lower():
return entry
raise IndexError(f"{name} doesn't exists in the catalog")
- pass
diff --git a/catalog_factories/construction_catalog_factory.py b/catalog_factories/construction_catalog_factory.py
index 6bbb59de..410103a8 100644
--- a/catalog_factories/construction_catalog_factory.py
+++ b/catalog_factories/construction_catalog_factory.py
@@ -8,7 +8,6 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
from pathlib import Path
from typing import TypeVar
from catalog_factories.construction.nrel_catalog import NrelCatalog
-from catalog_factories.construction.nrcan_catalog import NrcanCatalog
Catalog = TypeVar('Catalog')
class ConstructionCatalogFactory:
@@ -18,18 +17,13 @@ class ConstructionCatalogFactory:
self._catalog_type = '_' + file_type.lower()
self._path = base_path
+ @property
def _nrel(self):
"""
Retrieve NREL catalog
"""
return NrelCatalog(self._path)
- def _nrcan(self):
- """
- Retrieve NRCAN catalog
- """
- return NrcanCatalog(self._city, self._base_path)
-
@property
def catalog(self) -> Catalog:
"""
diff --git a/catalog_factories/data_models/construction/construction.py b/catalog_factories/data_models/construction/construction.py
index fc76371b..03eac115 100644
--- a/catalog_factories/data_models/construction/construction.py
+++ b/catalog_factories/data_models/construction/construction.py
@@ -46,18 +46,3 @@ class Construction:
"""
return self._layers
- @property
- def window_ratio(self):
- """
- Get construction window ratio (only when used as archetype construction)
- :return: (0..1) or None
- """
- return self._window_ratio
-
- @property
- def window(self):
- """
- Get construction window (only when used as archetype construction)
- :return: window or None
- """
- return self._window
diff --git a/catalog_factories/data_models/construction/window.py b/catalog_factories/data_models/construction/window.py
index 1f57f112..9c3a8b04 100644
--- a/catalog_factories/data_models/construction/window.py
+++ b/catalog_factories/data_models/construction/window.py
@@ -6,11 +6,19 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Window:
- def __init__(self, frame_ratio, g_value, overall_u_value, construction_name):
+ def __init__(self, frame_ratio, g_value, overall_u_value, name):
self._frame_ratio = frame_ratio
self._g_value = g_value
self._overall_u_value = overall_u_value
- self._construction_name = construction_name
+ self._name = name
+
+ @property
+ def name(self):
+ """
+ Get window name
+ :return: str
+ """
+ return self._name
@property
def frame_ratio(self):
@@ -34,12 +42,4 @@ class Window:
Get thermal opening overall U-value in W/m2K
:return: float
"""
- return self._overall_u_value
-
- @property
- def construction_name(self):
- """
- Get thermal opening construction name
- :return: str
- """
- return self._construction_name
+ return self._overall_u_value
\ No newline at end of file
diff --git a/city_model_structure/building.py b/city_model_structure/building.py
index f2ac273b..9c00647d 100644
--- a/city_model_structure/building.py
+++ b/city_model_structure/building.py
@@ -33,6 +33,7 @@ class Building(CityObject):
self._roof_type = None
self._internal_zones = None
self._shell = None
+ self._human_readable_name = None
self._type = 'building'
self._heating = dict()
self._cooling = dict()
@@ -322,3 +323,11 @@ class Building(CityObject):
if usage_zone.thermal_control is not None:
return True
return False
+
+ @property
+ def human_readable_name(self):
+ return self._human_readable_name
+
+ @human_readable_name.setter
+ def human_readable_name(self, value):
+ self._human_readable_name = value
\ No newline at end of file
diff --git a/city_model_structure/city_object.py b/city_model_structure/city_object.py
index bea861da..16447583 100644
--- a/city_model_structure/city_object.py
+++ b/city_model_structure/city_object.py
@@ -45,14 +45,6 @@ class CityObject:
"""
return self._name
- @name.setter
- def name(self, value):
- """
- Set city object name
- :return: str
- """
- self._name = value
-
@property
def lod(self) -> int:
"""
diff --git a/data/construction/ca_archetypes_reduced.xml b/data/construction/ca_archetypes_reduced.xml
deleted file mode 100644
index cc7758a3..00000000
--- a/data/construction/ca_archetypes_reduced.xml
+++ /dev/null
@@ -1,165 +0,0 @@
-
-
-
-
-
-
- 0.2
- 33
-
-
-
-
- 3
- 1
- 90
- 0.1
- 0.15
- 0.5
- 0
-
-
-
-
-
- 0.2
- 34
-
-
-
-
- 3
- 1
- 90
- 0.1
- 0.15
- 0.5
- 0
-
-
-
-
-
- 0.2
- 34
-
-
-
-
- 3
- 1
- 90
- 0.1
- 0.15
- 0.5
- 0
-
-
-
-
-
- 0.2
- 34
-
-
-
-
- 3
- 1
- 90
- 0.1
- 0.15
- 0.5
- 0
-
-
-
-
-
- 0.13
- 34
-
-
-
-
- 3
- 1
- 90
- 0.1
- 0.15
- 0.3
- 0
-
-
-
-
-
- 0.13
- 34
-
-
-
-
- 3
- 1
- 90
- 0.05
- 0.15
- 0.3
- 0
-
-
-
-
-
- 0.13
- 34
-
-
-
-
- 3
- 1
- 90
- 0.05
- 0.15
- 0.3
- 0
-
-
-
-
-
- 0.13
- 34
-
-
-
-
- 3
- 1
- 90
- 0.05
- 0.15
- 0.3
- 0
-
-
-
-
-
- 0.13
- 34
-
-
-
-
- 3
- 1
- 90
- 0.05
- 0.15
- 0.3
- 0
-
-
diff --git a/data/construction/ca_constructions_reduced.xml b/data/construction/ca_constructions_reduced.xml
deleted file mode 100644
index 42bf460e..00000000
--- a/data/construction/ca_constructions_reduced.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-
-
- 0.46
- 0.46
- 0.3
- 1.8
-
-
- 0.52
- 0.52
- 0.3
- 2.7
-
-
- 0.52
- 0.52
- 0.3
- 0.8
-
-
-
-
- 0.18
- 0.8
- 0.2
-
-
- 0.17
- 0.8
- 0.2
-
-
- 0.17
- 0.8
- 0.2
-
-
- 0.253
- 0.8
- 0.2
-
-
- 0.253
- 0.8
- 0.2
-
-
- 0.253
- 0.8
- 0.2
-
-
- 0.253
- 0.8
- 0.2
-
-
- 0.26
- 0.8
- 0.2
-
- #wall above grade
-
- 0.3
- 0.7
- 0.3
-
-
- 0.30
- 0.7
- 0.3
-
-
- 0.32
- 0.7
- 0.3
-
-
- 0.327
- 0.7
- 0.3
-
-
- 0.327
- 0.7
- 0.3
-
-
- 0.364
- 0.7
- 0.3
-
-
- 0.411
- 0.7
- 0.3
-
-
- 0.411
- 0.7
- 0.3
-
- #wall below grade
-
- 0.512
-
-
- 0.512
-
-
- 0.67
-
-
- 0.848
-
-
- 1.048
-
-
- 1.154
-
-
- 1.243
-
-
- 1.425
-
- #slab on grade
-
- 0.512
-
-
- 0.67
-
-
- 0.67
-
-
- 0.848
-
-
- 0.848
-
-
- 1.05
-
-
- 1.154
-
-
- 1.154
-
-
-
diff --git a/exports/energy_systems/__pycache__/__init__.cpython-38.pyc b/exports/energy_systems/__pycache__/__init__.cpython-38.pyc
deleted file mode 100644
index 2c72bf79..00000000
Binary files a/exports/energy_systems/__pycache__/__init__.cpython-38.pyc and /dev/null differ
diff --git a/exports/energy_systems/__pycache__/heat_pump_export.cpython-38.pyc b/exports/energy_systems/__pycache__/heat_pump_export.cpython-38.pyc
deleted file mode 100644
index f72a477e..00000000
Binary files a/exports/energy_systems/__pycache__/heat_pump_export.cpython-38.pyc and /dev/null differ
diff --git a/exports/energy_systems/air_source_hp_export.py b/exports/energy_systems/air_source_hp_export.py
index 29daa827..333b1d06 100644
--- a/exports/energy_systems/air_source_hp_export.py
+++ b/exports/energy_systems/air_source_hp_export.py
@@ -27,7 +27,7 @@ class AirSourceHPExport(HeatPumpExport):
template_path = (base_path / tmp_file)
super().__init__(base_path, city, output_path, template_path)
- def _extract_model_coff(self, hp_model: str, data_type='heat') -> Union[Tuple[List, List], None]:
+ def _extract_model_coff(self, hp_model: str, data_type='heat') -> Union[List, None]:
"""
Extracts heat pump coefficient data for a specific
model. e.g 012, 140
diff --git a/imports/construction/ca_physics_parameters.py b/imports/construction/ca_physics_parameters.py
deleted file mode 100644
index 445bb378..00000000
--- a/imports/construction/ca_physics_parameters.py
+++ /dev/null
@@ -1,83 +0,0 @@
-"""
-CaPhysicsParameters import the construction and material information for Canada
-SPDX - License - Identifier: LGPL - 3.0 - or -later
-Copyright © 2022 Concordia CERC group
-Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
-"""
-import sys
-from imports.construction.helpers.construction_helper import ConstructionHelper
-from imports.construction.nrel_physics_interface import NrelPhysicsInterface
-
-
-class CaPhysicsParameters(NrelPhysicsInterface):
- """
- CaPhysicsParameters class
- """
- def __init__(self, city, base_path):
- super().__init__(base_path, 'ca_constructions_reduced.xml', 'ca_archetypes_reduced.xml')
- self._city = city
-
- def enrich_buildings(self):
- """
- Returns the city with the construction parameters assigned to the buildings
- :return: None
- """
- city = self._city
- # it is assumed that all buildings have the same archetypes' keys
- for building in city.buildings:
- try:
- archetype = self._search_archetype(ConstructionHelper.nrcan_from_libs_function(building.function),
- building.year_of_construction)
- except KeyError:
- sys.stderr.write(f'Building {building.name} has unknown archetype for building function: '
- f'{ConstructionHelper.nrcan_from_libs_function(building.function)} '
- f'and building year of construction: {building.year_of_construction}\n')
- return
-
- # if building has no thermal zones defined from geometry, one thermal zone per storey is assigned
- if len(building.internal_zones) == 1:
- if building.internal_zones[0].thermal_zones is None:
- self._create_storeys(building, archetype)
-
- self._assign_values(building.internal_zones, archetype)
- for internal_zone in building.internal_zones:
- for thermal_zone in internal_zone.thermal_zones:
- self._calculate_view_factors(thermal_zone)
-
- def _search_archetype(self, function, year_of_construction):
- for building_archetype in self._building_archetypes:
- a_ft = str(building_archetype.archetype_keys['@function'])
- a_pc = str(building_archetype.archetype_keys['@periodOfConstruction'])
- a_yc1 = int(a_pc.split(sep='-')[0])
- a_yc2 = int(a_pc.split(sep='-')[1])
- if a_ft == str(function):
- if a_yc1 <= int(year_of_construction) <= a_yc2:
- return building_archetype
- return None
-
- def _assign_values(self, internal_zones, archetype):
- for internal_zone in internal_zones:
- for thermal_zone in internal_zone.thermal_zones:
- thermal_zone.additional_thermal_bridge_u_value = archetype.additional_thermal_bridge_u_value
- thermal_zone.effective_thermal_capacity = archetype.effective_thermal_capacity
- thermal_zone.indirectly_heated_area_ratio = archetype.indirectly_heated_area_ratio
- thermal_zone.infiltration_rate_system_on = archetype.infiltration_rate_system_on
- thermal_zone.infiltration_rate_system_off = archetype.infiltration_rate_system_off
- for thermal_boundary in thermal_zone.thermal_boundaries:
- construction_type = ConstructionHelper.nrcan_construction_types[thermal_boundary.type]
- thermal_boundary_archetype = self._search_construction_in_archetype(archetype, construction_type)
- thermal_boundary.u_value = thermal_boundary_archetype.overall_u_value
- thermal_boundary.outside_solar_absorptance = thermal_boundary_archetype.outside_solar_absorptance
- thermal_boundary.construction_name = thermal_boundary_archetype.construction_name
- try:
- thermal_boundary.window_ratio = thermal_boundary_archetype.window_ratio
- except ValueError:
- # This is the normal operation way when the windows are defined in the geometry
- continue
- if thermal_boundary.thermal_openings is not None:
- for thermal_opening in thermal_boundary.thermal_openings:
- if thermal_boundary_archetype.thermal_opening_archetype is not None:
- thermal_opening_archetype = thermal_boundary_archetype.thermal_opening_archetype
- thermal_opening.frame_ratio = thermal_opening_archetype.frame_ratio
- thermal_opening.g_value = thermal_opening_archetype.g_value
- thermal_opening.overall_u_value = thermal_opening_archetype.overall_u_value
diff --git a/imports/construction/helpers/construction_helper.py b/imports/construction/helpers/construction_helper.py
index c81180ed..04c45b6c 100644
--- a/imports/construction/helpers/construction_helper.py
+++ b/imports/construction/helpers/construction_helper.py
@@ -71,42 +71,6 @@ class ConstructionHelper:
cte.ROOF: 'roof'
}
- # NRCAN
- _function_to_nrcan = {
- cte.RESIDENTIAL: 'residential',
- cte.SINGLE_FAMILY_HOUSE: 'residential',
- cte.MULTI_FAMILY_HOUSE: 'residential',
- cte.ROW_HOSE: 'residential',
- cte.MID_RISE_APARTMENT: 'residential',
- cte.HIGH_RISE_APARTMENT: 'residential',
- cte.SMALL_OFFICE: cte.SMALL_OFFICE,
- cte.MEDIUM_OFFICE: cte.MEDIUM_OFFICE,
- cte.LARGE_OFFICE: cte.LARGE_OFFICE,
- cte.PRIMARY_SCHOOL: cte.PRIMARY_SCHOOL,
- cte.SECONDARY_SCHOOL: cte.SECONDARY_SCHOOL,
- cte.STAND_ALONE_RETAIL: cte.STAND_ALONE_RETAIL,
- cte.HOSPITAL: cte.HOSPITAL,
- cte.OUT_PATIENT_HEALTH_CARE: cte.OUT_PATIENT_HEALTH_CARE,
- cte.STRIP_MALL: cte.STRIP_MALL,
- cte.SUPERMARKET: cte.SUPERMARKET,
- cte.WAREHOUSE: cte.WAREHOUSE,
- cte.QUICK_SERVICE_RESTAURANT: cte.QUICK_SERVICE_RESTAURANT,
- cte.FULL_SERVICE_RESTAURANT: cte.FULL_SERVICE_RESTAURANT,
- cte.SMALL_HOTEL: cte.SMALL_HOTEL,
- cte.LARGE_HOTEL: cte.LARGE_HOTEL
- }
-
- nrcan_window_types = [cte.WINDOW]
-
- nrcan_construction_types = {
- cte.WALL: 'wall',
- cte.GROUND_WALL: 'basement_wall',
- cte.GROUND: 'floor',
- cte.ATTIC_FLOOR: 'attic floor',
- cte.INTERIOR_SLAB: 'floor',
- cte.ROOF: 'roof'
- }
-
@staticmethod
def nrel_from_libs_function(function):
"""
@@ -153,16 +117,4 @@ class ConstructionHelper:
:return: str
"""
reference_city = ConstructionHelper.city_to_reference_city(city)
- return ConstructionHelper._reference_city_to_nrel_climate_zone[reference_city]
-
- @staticmethod
- def nrcan_from_libs_function(function):
- """
- Get NREL function from the given internal function key
- :param function: str
- :return: str
- """
- try:
- return ConstructionHelper._function_to_nrcan[function]
- except KeyError:
- sys.stderr.write('Error: keyword not found.\n')
+ return ConstructionHelper._reference_city_to_nrel_climate_zone[reference_city]
\ No newline at end of file
diff --git a/imports/construction_factory.py b/imports/construction_factory.py
index 3298bf51..b201555b 100644
--- a/imports/construction_factory.py
+++ b/imports/construction_factory.py
@@ -6,7 +6,6 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from pathlib import Path
from imports.construction.us_physics_parameters import UsPhysicsParameters
-from imports.construction.ca_physics_parameters import CaPhysicsParameters
class ConstructionFactory:
@@ -26,19 +25,9 @@ class ConstructionFactory:
"""
UsPhysicsParameters(self._city, self._base_path).enrich_buildings()
- def _nrcan(self):
- """
- Enrich the city by using NRCAN information
- :alert: NRCAN handler only contains simplified construction information (residential)
- """
- CaPhysicsParameters(self._city, self._base_path).enrich_buildings()
-
def enrich(self):
"""
Enrich the city given to the class using the class given handler
:return: None
"""
- getattr(self, self._handler, lambda: None)()
-
- def _enrich_debug(self):
- self._nrel()
+ getattr(self, self._handler, lambda: None)()
\ No newline at end of file
diff --git a/imports/energy_systems/air_source_hp_parameters.py b/imports/energy_systems/air_source_hp_parameters.py
index decb6617..72cf41e8 100644
--- a/imports/energy_systems/air_source_hp_parameters.py
+++ b/imports/energy_systems/air_source_hp_parameters.py
@@ -22,7 +22,7 @@ class AirSourceHeatPumpParameters:
def __init__(self, city, base_path):
self._city = city
- self._base_path = (base_path / 'heat_pumps/Air source.xlsx')
+ self._base_path = (base_path / 'heat_pumps/air_source.xlsx')
def _read_file(self) -> Dict:
"""
diff --git a/unittests/test_construction_catalog.py b/unittests/test_construction_catalog.py
new file mode 100644
index 00000000..8ee48cae
--- /dev/null
+++ b/unittests/test_construction_catalog.py
@@ -0,0 +1,33 @@
+"""
+TestConstructionCatalog
+SPDX - License - Identifier: LGPL - 3.0 - or -later
+Copyright © 2022 Concordia CERC group
+Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
+"""
+
+from unittest import TestCase
+from catalog_factories.construction_catalog_factory import ConstructionCatalogFactory
+
+
+class TestConstructionCatalog(TestCase):
+
+ def test_nrel_catalog(self):
+ catalog = ConstructionCatalogFactory('nrel').catalog
+ catalog_categories = catalog.names()
+ constructions = catalog.names('constructions')
+ windows = catalog.names('windows')
+ materials = catalog.names('materials')
+ self.assertTrue(len(constructions['constructions']), 24)
+ self.assertTrue(len(windows['windows']), 4)
+ self.assertTrue(len(materials['materials']), 19)
+ with self.assertRaises(ValueError):
+ catalog.names('unknown')
+
+ # retrieving all the entries should not raise any exceptions
+ for category in catalog_categories:
+ for value in catalog_categories[category]:
+ catalog.get_entry(value)
+
+ with self.assertRaises(IndexError):
+ catalog.get_entry('unknown')
+
diff --git a/unittests/test_construction_factory.py b/unittests/test_construction_factory.py
index 8eeb16ab..b04cc901 100644
--- a/unittests/test_construction_factory.py
+++ b/unittests/test_construction_factory.py
@@ -168,36 +168,6 @@ class TestConstructionFactory(TestCase):
for building in city.buildings:
self.assertRaises(Exception, lambda: self._internal_function(function_format, building.function))
- def test_city_with_construction_reduced_library(self):
- """
- Enrich the city with the construction reduced library and verify it
- """
- file = 'one_building_in_kelowna.gml'
- city = self._get_citygml(file)
- for building in city.buildings:
- building.function = GeometryHelper.libs_function_from_hft(building.function)
- ConstructionFactory('nrcan', city).enrich()
-
- self._check_buildings(city)
- for building in city.buildings:
- for internal_zone in building.internal_zones:
- self._check_thermal_zones(internal_zone)
- for thermal_zone in internal_zone.thermal_zones:
- self._check_thermal_boundaries(thermal_zone)
- for thermal_boundary in thermal_zone.thermal_boundaries:
- self.assertIsNone(thermal_boundary.outside_thermal_absorptance, 'outside_thermal_absorptance is not none')
- self.assertIsNone(thermal_boundary.outside_visible_absorptance, 'outside_visible_absorptance is not none')
- self.assertIsNone(thermal_boundary.layers, 'layers is not none')
-
- self._check_thermal_openings(thermal_boundary)
- for thermal_opening in thermal_boundary.thermal_openings:
- self.assertIsNone(thermal_opening.conductivity, 'thermal_opening conductivity is not none')
- self.assertIsNone(thermal_opening.thickness, 'thermal opening thickness is not none')
- self.assertIsNone(thermal_opening.front_side_solar_transmittance_at_normal_incidence,
- 'thermal opening front_side_solar_transmittance_at_normal_incidence is not none')
- self.assertIsNone(thermal_opening.back_side_solar_transmittance_at_normal_incidence,
- 'thermal opening back_side_solar_transmittance_at_normal_incidence is not none')
-
def test_city_with_construction_extended_library(self):
"""
Enrich the city with the construction information and verify it
diff --git a/unittests/test_enrichement.py b/unittests/test_enrichement.py
index bf0af703..3507e3d6 100644
--- a/unittests/test_enrichement.py
+++ b/unittests/test_enrichement.py
@@ -90,7 +90,7 @@ class TestGeometryFactory(TestCase):
UsageFactory(usage_key, city).enrich()
def _test_hft(self, file):
- _construction_keys = ['nrel', 'nrcan']
+ _construction_keys = ['nrel']
_usage_keys = ['ca', 'comnet', 'hft']
for construction_key in _construction_keys:
for usage_key in _usage_keys:
diff --git a/unittests/test_greenery_catalog.py b/unittests/test_greenery_catalog.py
index efb94d6b..7959b127 100644
--- a/unittests/test_greenery_catalog.py
+++ b/unittests/test_greenery_catalog.py
@@ -12,7 +12,7 @@ from catalog_factories.greenery_catalog_factory import GreeneryCatalogFactory
class TestGreeneryCatalog(TestCase):
def test_catalog(self):
- catalog = GreeneryCatalogFactory('nrel').catalog_debug
+ catalog = GreeneryCatalogFactory('nrel').catalog
catalog_categories = catalog.names()
vegetations = catalog.names('vegetations')
plants = catalog.names('plants')
diff --git a/unittests/test_life_cycle_assessment_factory.py b/unittests/test_life_cycle_assessment_factory.py
index 2c5de645..43ba7feb 100644
--- a/unittests/test_life_cycle_assessment_factory.py
+++ b/unittests/test_life_cycle_assessment_factory.py
@@ -47,8 +47,8 @@ class TestLifeCycleAssessment(TestCase):
city_file = "../unittests/tests_data/C40_Final.gml"
city = GeometryFactory('citygml', city_file).city
LifeCycleAssessment('material', city).enrich()
- for material in city.materials:
- self.assertTrue(len(city.materials) > 0)
+ for material in city.lca_materials:
+ self.assertTrue(len(city.lca_materials) > 0)