Beispiel #1
0
def test_shade_dict_methods():
    """Test the to/from dict methods."""
    shade_mat = EnergyWindowMaterialShade('Low-e Diffusing Shade', 0.025, 0.15,
                                          0.5, 0.25, 0.5, 0, 0.4, 0.2, 0.1,
                                          0.75, 0.25)
    material_dict = shade_mat.to_dict()
    new_material = EnergyWindowMaterialShade.from_dict(material_dict)
    assert material_dict == new_material.to_dict()
def material_window_shade(directory):
    shades = EnergyWindowMaterialShade('White Diffusing Roller Shade')
    dest_file = os.path.join(directory, 'material_window_shade.json')
    with open(dest_file, 'w') as fp:
        json.dump(shades.to_dict(), fp, indent=4)