Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
lay.material.material_id = material_dict[lay.material.name][1]
out_wall.save_type_element(data_class=dc_new)
for pyxb_wall in dc_old.element_bind.Rooftop:
roof = Rooftop()
roof.load_type_element(pyxb_wall.building_age_group[0] + 2,
pyxb_wall.construction_type,
dc_old)
for lay in roof.layer:
lay.material.material_id = material_dict[lay.material.name][1]
roof.save_type_element(data_class=dc_new)
for pyxb_wall in dc_old.element_bind.GroundFloor:
gf = GroundFloor()
gf.load_type_element(pyxb_wall.building_age_group[0] + 2,
pyxb_wall.construction_type,
dc_old)
for lay in gf.layer:
lay.material.material_id = material_dict[lay.material.name][1]
gf.save_type_element(data_class=dc_new)
for key, value in material_dict.items():
value[0].name = key
value[0].density = value[2]
value[0].thermal_conduc = value[3]
value[0].heat_capac = value[4]
value[0].save_material_template(data_class=dc_new)
"hence this building element is not added. Here is the "
"list of faulty entries:\n%s"
"\nThese entries can easily be found checking the stated "
"index in the produced ZonedInput.xlsx"
% (
group["Zone"].iloc[0],
group["WindowOrientation[°]"].iloc[0],
group,
)
)
grouped = zone.groupby(["IsGroundFloor", "FloorConstruction"])
for name, group in grouped:
if group["NetArea[m²]"].sum() != 0: # to avoid devision by 0
if group["IsGroundFloor"].iloc[0] == 1:
ground_floor = GroundFloor(parent=tz)
ground_floor.name = "ground_floor" + str(
group["FloorConstruction"].iloc[0]
)
ground_floor.area = group["NetArea[m²]"].sum()
ground_floor.tilt = ground_floor_tilt
ground_floor.orientation = ground_floor_orientation
# load wall properties from "TypeBuildingElements.json"
ground_floor.load_type_element(
year=bldg.year_of_construction,
construction=group["FloorConstruction"].iloc[0],
)
warn_constructiontype(ground_floor)
elif group["IsGroundFloor"].iloc[0] == 0:
floor = Floor(parent=tz)
floor.name = "floor" + str(group["FloorConstruction"].iloc[0])
floor.area = group["NetArea[m²]"].sum() / 2 # only half of
win_2_layer = Layer(parent=win_2)
win_2_layer.id = 1
win_2_layer.thickness = 0.024
win_2_material = Material(win_2_layer)
win_2_material.name = "GlasWindow"
win_2_material.thermal_conduc = 0.15
win_2_material.transmittance = 0.907
win_2_material.ir_emissivity = 0.9
# This is a dummy ground floor to export three and four elements models.
# Please set values for floor plate in three element and four element
# models to default.
if number_of_elements >= 3:
out_wall_gf = GroundFloor(parent=tz)
out_wall_gf.name = "ExtWallGroundFloor"
out_wall_gf.area = 6 * 8
out_wall_gf.orientation = -2.0
out_wall_gf.tilt = 0.0
out_wall_gf.inner_convection = 4.13
out_wall_gf.inner_radiation = 5.13
layer_ofgw1 = Layer(parent=out_wall_gf, id=0)
layer_ofgw1.thickness = 1.003
material_ofgw1 = Material(layer_ofgw1)
material_ofgw1.name = "Insulation"
material_ofgw1.density = 0.0001 # as small as possible
material_ofgw1.heat_capac = 0.0001 # as small as possible
material_ofgw1.thermal_conduc = 0.04
'''
if type == "Outer Wall":
element = OuterWall(parent)
element.name = name
element.area = area
if type == "Inner Wall":
element = InnerWall(parent)
element.name = name
element.area = area
if type == "Window":
element = Window(parent)
element.name = name
element.area = area
if type == "GroundFloor":
element = GroundFloor(parent)
element.name = name
element.area = area
if type == "Ceiling":
element = Ceiling(parent)
element.name = name
element.area = area
if type == "Rooftop":
element = Rooftop(parent)
element.name = name
element.area = area
if type == "Floor":
element = Floor(parent)
element.name = name
element.area = area
return parent
'''
if type == "Outer Wall":
element = OuterWall(parent)
element.name = name
element.area = area
if type == "Inner Wall":
element = InnerWall(parent)
element.name = name
element.area = area
if type == "Window":
element = Window(parent)
element.name = name
element.area = area
if type == "GroundFloor":
element = GroundFloor(parent)
element.name = name
element.area = area
if type == "Ceiling":
element = Ceiling(parent)
element.name = name
element.area = area
if type == "Rooftop":
element = Rooftop(parent)
element.name = name
element.area = area
if type == "Floor":
element = Floor(parent)
element.name = name
element.area = area
return parent
win_2_layer = Layer(parent=win_2)
win_2_layer.id = 1
win_2_layer.thickness = 0.024
win_2_material = Material(win_2_layer)
win_2_material.name = "GlasWindow"
win_2_material.thermal_conduc = 0.15
win_2_material.transmittance = 0.907
win_2_material.ir_emissivity = 0.9
# This is a dummy ground floor to export three and four elements models.
# Please set values for floor plate in three element and four element
# models to default.
if number_of_elements >= 3:
out_wall_gf = GroundFloor(parent=tz)
out_wall_gf.name = "ExtWallGroundFloor"
out_wall_gf.area = 6 * 8
out_wall_gf.orientation = -2.0
out_wall_gf.tilt = 0.0
out_wall_gf.inner_convection = 4.13
out_wall_gf.inner_radiation = 5.13
layer_ofgw1 = Layer(parent=out_wall_gf, id=0)
layer_ofgw1.thickness = 1.003
material_ofgw1 = Material(layer_ofgw1)
material_ofgw1.name = "Insulation"
material_ofgw1.density = 0.0001 # as small as possible
material_ofgw1.heat_capac = 0.0001 # as small as possible
material_ofgw1.thermal_conduc = 0.04
self.outer_area[value[1]] = self._est_roof_area
for zone in self.thermal_zones:
roof = Rooftop(zone)
roof.load_type_element(self.year_of_construction,
self.construction_type)
roof.name = key
roof.tilt = value[0]
roof.orientation = value[1]
for key, value in self.ground_floor_names.items():
self.outer_area[value[1]] = self._est_ground_floor_area
for zone in self.thermal_zones:
ground_floor = GroundFloor(zone)
ground_floor.load_type_element(self.year_of_construction,
self.construction_type)
ground_floor.name = key
ground_floor.tilt = value[0]
ground_floor.orientation = value[1]
for key, value in self.inner_wall_names.items():
for zone in self.thermal_zones:
inner_wall = InnerWall(zone)
inner_wall.load_type_element(self.year_of_construction,
self.construction_type)
inner_wall.name = key
inner_wall.tilt = value[0]
inner_wall.orientation = value[1]
# zone.inner_walls.append(inner_wall)
def __init__(self, parent=None):
"""
"""
super(GroundFloor, self).__init__(parent)
self._tilt = 0.0
self._orientation = -2.0
self._inner_convection = 1.7
self._inner_radiation = 5.0
self._outer_convection = None
self._outer_radiation = None
wall.outer_convection = rooftop.outer_convection
wall.outer_radiation = rooftop.outer_radiation
for layerBind in rooftop.Layers.layer:
layer = Layer()
layer.id = layerBind.id - 1
layer.thickness = layerBind.thickness
material = Material(layer)
material.name = layerBind.Material.name
material.density = layerBind.Material.density
material.thermal_conduc = layerBind.Material.thermal_conduc
material.heat_capac = layerBind.Material.heat_capac
wall.add_layer(layer, layer.id)
zone.add_element(wall)
for groundfloor in project.data.element_bind.GroundFloor:
wall = GroundFloor()
wall.name = "GroundFloor"
wall.construction_type = groundfloor.construction_type
wall.year_of_construction = \
groundfloor.year_of_construction
wall.building_age_group = groundfloor.building_age_group
wall.inner_convection = groundfloor.inner_convection
wall.inner_radiation = groundfloor.inner_radiation
for layerBind in groundfloor.Layers.layer:
layer = Layer()
layer.id = layerBind.id - 1
layer.thickness = layerBind.thickness
material = Material(layer)
material.name = layerBind.Material.name
material.density = layerBind.Material.density
material.thermal_conduc = layerBind.Material.thermal_conduc
material.heat_capac = layerBind.Material.heat_capac