def test_set_construction_set(): """Test the setting of a ConstructionSet on a Room2D.""" pts = (Point3D(0, 0, 3), Point3D(10, 0, 3), Point3D(10, 10, 3), Point3D(0, 10, 3)) ashrae_base = SimpleWindowRatio(0.4) overhang = Overhang(1) boundarycs = (bcs.outdoors, bcs.ground, bcs.outdoors, bcs.ground) window = (ashrae_base, None, ashrae_base, None) shading = (overhang, None, None, None) room = Room2D('SquareShoebox', Face3D(pts), 3, boundarycs, window, shading) mass_set = ConstructionSet('Thermal Mass Construction Set') concrete20 = EnergyMaterial('20cm Concrete', 0.2, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) concrete10 = EnergyMaterial('10cm Concrete', 0.1, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) thick_constr = OpaqueConstruction('Thick Concrete Construction', [concrete20]) thin_constr = OpaqueConstruction('Thin Concrete Construction', [concrete10]) shade_constr = ShadeConstruction('Light Shelf', 0.5, 0.5) mass_set.wall_set.exterior_construction = thick_constr mass_set.roof_ceiling_set.interior_construction = thin_constr mass_set.shade_construction = shade_constr room.properties.energy.construction_set = mass_set assert room.properties.energy.construction_set == mass_set hb_room, adj = room.to_honeybee() assert hb_room.properties.energy.construction_set == mass_set assert hb_room[1].properties.energy.construction == thick_constr assert hb_room[5].properties.energy.construction == thin_constr assert hb_room[1].shades[0].properties.energy.construction == shade_constr
def test_setting_construction(): """Test the setting of constructions on the ConstructionSet.""" default_set = ConstructionSet('Thermal Mass Construction Set') concrete20 = EnergyMaterial('20cm Concrete', 0.2, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) concrete10 = EnergyMaterial('10cm Concrete', 0.1, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) stone_door = EnergyMaterial('Stone Door', 0.05, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) thick_constr = OpaqueConstruction('Thick Concrete Construction', [concrete20]) thin_constr = OpaqueConstruction('Thin Concrete Construction', [concrete10]) door_constr = OpaqueConstruction('Stone Door', [stone_door]) light_shelf = ShadeConstruction('Light Shelf', 0.5, 0.5, True) default_set.wall_set.exterior_construction = thick_constr assert default_set.wall_set.exterior_construction == thick_constr assert len(default_set.modified_constructions_unique) == 1 assert len(default_set.modified_materials_unique) == 1 assert isinstance(default_set.wall_set.exterior_construction[0], EnergyMaterial) with pytest.raises(AttributeError): default_set.wall_set.exterior_construction[0].thickness = 0.15 default_set.wall_set.interior_construction = thin_constr assert default_set.wall_set.interior_construction == thin_constr default_set.wall_set.ground_construction = thick_constr assert default_set.wall_set.ground_construction == thick_constr default_set.floor_set.exterior_construction = thick_constr assert default_set.floor_set.exterior_construction == thick_constr default_set.floor_set.interior_construction = thin_constr assert default_set.floor_set.interior_construction == thin_constr default_set.floor_set.ground_construction = thick_constr assert default_set.floor_set.ground_construction == thick_constr default_set.roof_ceiling_set.exterior_construction = thick_constr assert default_set.roof_ceiling_set.exterior_construction == thick_constr default_set.roof_ceiling_set.interior_construction = thin_constr assert default_set.roof_ceiling_set.interior_construction == thin_constr default_set.roof_ceiling_set.ground_construction = thick_constr assert default_set.roof_ceiling_set.ground_construction == thick_constr default_set.door_set.exterior_construction = door_constr assert default_set.door_set.exterior_construction == door_constr default_set.door_set.interior_construction = door_constr assert default_set.door_set.interior_construction == door_constr default_set.door_set.overhead_construction = door_constr assert default_set.door_set.overhead_construction == door_constr default_set.shade_construction = light_shelf assert default_set.shade_construction == light_shelf assert len(default_set.modified_constructions_unique) == 4 assert len(default_set.modified_materials_unique) == 3
def test_set_construction_set(): """Test the setting of a ConstructionSet on a Story.""" pts_1 = (Point3D(0, 0, 3), Point3D(0, 10, 3), Point3D(10, 10, 3), Point3D(10, 0, 3)) pts_2 = (Point3D(10, 0, 3), Point3D(10, 10, 3), Point3D(20, 10, 3), Point3D(20, 0, 3)) pts_3 = (Point3D(0, 10, 3), Point3D(0, 20, 3), Point3D(10, 20, 3), Point3D(10, 10, 3)) pts_4 = (Point3D(10, 10, 3), Point3D(10, 20, 3), Point3D(20, 20, 3), Point3D(20, 10, 3)) room2d_1 = Room2D('Office1', Face3D(pts_1), 3) room2d_2 = Room2D('Office2', Face3D(pts_2), 3) room2d_3 = Room2D('Office3', Face3D(pts_3), 3) room2d_4 = Room2D('Office4', Face3D(pts_4), 3) story = Story('OfficeFloor', [room2d_1, room2d_2, room2d_3, room2d_4]) story.solve_room_2d_adjacency(0.01) story.set_outdoor_window_parameters(SimpleWindowRatio(0.4)) mass_set = ConstructionSet('Thermal Mass Construction Set') concrete20 = EnergyMaterial('20cm Concrete', 0.2, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) concrete10 = EnergyMaterial('10cm Concrete', 0.1, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) thick_constr = OpaqueConstruction('Thick Concrete Construction', [concrete20]) thin_constr = OpaqueConstruction('Thin Concrete Construction', [concrete10]) shade_constr = ShadeConstruction('Light Shelf', 0.5, 0.5) mass_set.wall_set.exterior_construction = thick_constr mass_set.roof_ceiling_set.interior_construction = thin_constr mass_set.shade_construction = shade_constr story.properties.energy.construction_set = mass_set assert story.properties.energy.construction_set == mass_set assert story[0].properties.energy.construction_set == mass_set rooms = story.to_honeybee() model = hb_model.Model(story.identifier, rooms) assert len(model.properties.energy.construction_sets) == 1 assert model.properties.energy.construction_sets[0] == mass_set assert model.rooms[0].properties.energy.construction_set == mass_set
def test_set_construction_set(): """Test the setting of a ConstructionSet on a Room.""" room = Room.from_box('Shoe Box', 5, 10, 3) door_verts = [[1, 0, 0.1], [2, 0, 0.1], [2, 0, 3], [1, 0, 3]] room[3].add_door(Door.from_vertices('test_door', door_verts)) room[1].apertures_by_ratio(0.4, 0.01) room[1].apertures[0].overhang(0.5, indoor=False) room[1].apertures[0].overhang(0.5, indoor=True) room[1].apertures[0].move_shades(Vector3D(0, 0, -0.5)) mass_set = ConstructionSet('Thermal Mass Construction Set') concrete20 = EnergyMaterial('20cm Concrete', 0.2, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) concrete10 = EnergyMaterial('10cm Concrete', 0.1, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) stone_door = EnergyMaterial('Stone Door', 0.05, 2.31, 2322, 832, 'MediumRough', 0.95, 0.75, 0.8) thick_constr = OpaqueConstruction('Thick Concrete Construction', [concrete20]) thin_constr = OpaqueConstruction('Thin Concrete Construction', [concrete10]) door_constr = OpaqueConstruction('Stone Door', [stone_door]) shade_constr = ShadeConstruction('Light Shelf', 0.5, 0.5) mass_set.wall_set.exterior_construction = thick_constr mass_set.roof_ceiling_set.exterior_construction = thin_constr mass_set.door_set.exterior_construction = door_constr mass_set.shade_construction = shade_constr room.properties.energy.construction_set = mass_set assert room.properties.energy.construction_set == mass_set assert room[1].properties.energy.construction == thick_constr assert room[5].properties.energy.construction == thin_constr assert room[3].doors[0].properties.energy.construction == door_constr assert room[1].apertures[0].shades[ 0].properties.energy.construction == shade_constr with pytest.raises(AttributeError): room[1].properties.energy.construction.thickness = 0.3 with pytest.raises(AttributeError): room[5].properties.energy.construction.thickness = 0.3 with pytest.raises(AttributeError): room[3].doors[0].properties.energy.construction.thickness = 0.3