コード例 #1
0
def test_opaque_lockability():
    """Test the lockability of the construction."""
    concrete = EnergyMaterial('Concrete', 0.15, 2.31, 2322, 832, 'MediumRough',
                              0.95, 0.75, 0.8)
    insulation = EnergyMaterialNoMass('Insulation R-3', 3, 'MediumSmooth')
    wall_gap = EnergyMaterial('Wall Air Gap', 0.1, 0.67, 1.2925, 1006.1)
    gypsum = EnergyMaterial('Gypsum', 0.0127, 0.16, 784.9, 830, 'MediumRough',
                            0.93, 0.6, 0.65)
    wall_constr = OpaqueConstruction('Generic Wall Construction',
                                     [concrete, insulation, wall_gap, gypsum])

    wall_constr.materials = [concrete, wall_gap, gypsum]
    wall_constr.lock()
    with pytest.raises(AttributeError):
        wall_constr.materials = [concrete, insulation, wall_gap, gypsum]
    with pytest.raises(AttributeError):
        wall_constr[0].density = 600
    wall_constr.unlock()
    wall_constr.materials = [concrete, insulation, wall_gap, gypsum]
    wall_constr[0].density = 600
コード例 #2
0
    'generic_double_pane': (_m.lowe_glass, _m.air_gap, _m.clear_glass),
    'generic_single_pane': (_m.clear_glass),
    'generic_exterior_door': (_m.painted_metal, _m.insulation_thin,
                              _m.painted_metal),
    'generic_interior_door': (_m.wood),
    'air_wall': (_m.air)
}

# establish variables for the default constructions used across the library
# and auto-generate constructions if they were not loaded from default.idf
try:
    generic_exterior_wall = _idf_opaque_constructions['Generic Exterior Wall']
except KeyError:
    generic_exterior_wall = OpaqueConstruction(
        'Generic Exterior Wall', _default_prop['generic_exterior_wall'])
    generic_exterior_wall.lock()
    _idf_opaque_constructions['Generic Exterior Wall'] = generic_exterior_wall

try:
    generic_interior_wall = _idf_opaque_constructions['Generic Interior Wall']
except KeyError:
    generic_interior_wall = OpaqueConstruction(
        'Generic Interior Wall', _default_prop['generic_interior_wall'])
    generic_interior_wall.lock()
    _idf_opaque_constructions['Generic Interior Wall'] = generic_interior_wall

try:
    generic_underground_wall = _idf_opaque_constructions[
        'Generic Underground Wall']
except KeyError:
    generic_underground_wall = OpaqueConstruction(