From 4f624e1143f8ac65085f127e3b3a8401142281ae Mon Sep 17 00:00:00 2001 From: guille Date: Mon, 4 Apr 2022 22:41:34 -0400 Subject: [PATCH] API required changes --- .../building_demand/thermal_opening.py | 15 +++++++++++++++ city_model_structure/city_object.py | 8 ++++++++ .../data_classes/thermal_opening_archetype.py | 18 +++++++++++++++++- imports/construction/nrel_physics_interface.py | 4 +++- imports/construction/us_physics_parameters.py | 1 + 5 files changed, 44 insertions(+), 2 deletions(-) diff --git a/city_model_structure/building_demand/thermal_opening.py b/city_model_structure/building_demand/thermal_opening.py index 101dcffc..ae695187 100644 --- a/city_model_structure/building_demand/thermal_opening.py +++ b/city_model_structure/building_demand/thermal_opening.py @@ -31,6 +31,7 @@ class ThermalOpening: self._inside_emissivity = None self._alpha_coefficient = None self._radiative_coefficient = None + self._construction_name = None @property def id(self): @@ -290,3 +291,17 @@ class ThermalOpening: """ if value is not None: self._radiative_coefficient = float(value) + + @property + def construction_name(self): + """ + Get thermal opening construction name + """ + return self._construction_name + + @construction_name.setter + def construction_name(self, value): + """ + Set thermal opening construction name + """ + self._construction_name = value diff --git a/city_model_structure/city_object.py b/city_model_structure/city_object.py index d71e3cea..5604f6e0 100644 --- a/city_model_structure/city_object.py +++ b/city_model_structure/city_object.py @@ -44,6 +44,14 @@ class CityObject: """ return self._name + @name.setter + def name(self, value): + """ + Set building name + :return: str + """ + self._name = value + @property def lod(self) -> int: """ diff --git a/imports/construction/data_classes/thermal_opening_archetype.py b/imports/construction/data_classes/thermal_opening_archetype.py index e1966267..fc729769 100644 --- a/imports/construction/data_classes/thermal_opening_archetype.py +++ b/imports/construction/data_classes/thermal_opening_archetype.py @@ -12,7 +12,8 @@ class ThermalOpeningArchetype: def __init__(self, conductivity=None, frame_ratio=None, g_value=None, thickness=None, back_side_solar_transmittance_at_normal_incidence=None, front_side_solar_transmittance_at_normal_incidence=None, overall_u_value=None, - openable_ratio=None, inside_emissivity=None, alpha_coefficient=None, radiative_coefficient=None): + openable_ratio=None, inside_emissivity=None, alpha_coefficient=None, radiative_coefficient=None, + construction_name=None): self._conductivity = conductivity self._frame_ratio = frame_ratio self._g_value = g_value @@ -24,6 +25,7 @@ class ThermalOpeningArchetype: self._inside_emissivity = inside_emissivity self._alpha_coefficient = alpha_coefficient self._radiative_coefficient = radiative_coefficient + self._construction_name = construction_name @property def conductivity(self): @@ -112,3 +114,17 @@ class ThermalOpeningArchetype: :return: float """ return self._radiative_coefficient + + @property + def construction_name(self): + """ + Get thermal opening construction name + """ + return self._construction_name + + @construction_name.setter + def construction_name(self, value): + """ + Set thermal opening construction name + """ + self._construction_name = value diff --git a/imports/construction/nrel_physics_interface.py b/imports/construction/nrel_physics_interface.py index 6f08e536..1c23b106 100644 --- a/imports/construction/nrel_physics_interface.py +++ b/imports/construction/nrel_physics_interface.py @@ -109,6 +109,7 @@ class NrelPhysicsInterface: if 'window' in construction and construction['window'] is not None: window_ratio = construction['window_ratio']['#text'] w_lib = self._search_construction_type('window', construction['window']) + window_construction_name = w_lib['@name'] frame_ratio = w_lib['frame_ratio']['#text'] if 'conductivity' in w_lib: conductivity = w_lib['conductivity']['#text'] @@ -128,7 +129,8 @@ class NrelPhysicsInterface: thickness=thickness, back_side_solar_transmittance_at_normal_incidence= back_side_solar_transmittance_at_normal_incidence, front_side_solar_transmittance_at_normal_incidence= - front_side_solar_transmittance_at_normal_incidence) + front_side_solar_transmittance_at_normal_incidence, + construction_name=window_construction_name) else: overall_u_value = w_lib['overall_u_value']['#text'] units = w_lib['overall_u_value']['@units'] diff --git a/imports/construction/us_physics_parameters.py b/imports/construction/us_physics_parameters.py index 7a23b318..9673d921 100644 --- a/imports/construction/us_physics_parameters.py +++ b/imports/construction/us_physics_parameters.py @@ -99,6 +99,7 @@ class UsPhysicsParameters(NrelPhysicsInterface): 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.construction_name = thermal_opening_archetype.construction_name thermal_opening.frame_ratio = thermal_opening_archetype.frame_ratio thermal_opening.g_value = thermal_opening_archetype.g_value thermal_opening.conductivity = thermal_opening_archetype.conductivity