def test_makewindows():
    """py.test for makewindows"""
    data = Window_Data
    result = eplusgeom.makewindows(data.dct1)
    eplustxt = data.eplustxt1
    # for resultline, eplusline in zip(result.splitlines(), eplustxt.splitlines()):
    #     print resultline
    #     print eplusline
    #     assert resultline == eplusline
    assert result == eplustxt
    result = eplusgeom.makewindows(data.dct2)
    eplustxt = data.eplustxt2
    # for resultline, eplusline in zip(result.splitlines(), eplustxt.splitlines()):
    #     print resultline
    #     print eplusline
    #     assert resultline == eplusline
    assert result == eplustxt
Пример #2
0
def makeidf(txt):
    """make idf file from the file generated by sketchup"""
    dct = readsketchup.readsketchup(txt)
    dct = readsketchup.duplicatewindows(dct)
    dct = readsketchup.inch2meters(dct)
    zonestxt = eplusgeom.makezones(dct)
    wallstxt = eplusgeom.makewalls(dct)
    windowstxt = eplusgeom.makewindows(dct)

    snippet1 = """
VERSION,
    1.3;                     !- Version Identifier

!-   ===========  ALL OBJECTS IN CLASS: BUILDING ===========

BUILDING,
    Building,                !- Building Name
    0.,                      !- North Axis {deg}
    City,                    !- Terrain
    0.04,                    !- Loads Convergence Tolerance Value {W}
    0.4,                     !- Temperature Convergence Tolerance Value {deltaC}
    FullExterior,            !- Solar Distribution
    25;                      !- Maximum Number of Warmup Days


"""
    snippet2 = """
!-   ===========  ALL OBJECTS IN CLASS: SURFACEGEOMETRY ===========

SurfaceGeometry,
    UpperLeftCorner,         !- SurfaceStartingPosition
    CCW,        !- VertexEntry
    WCS;                     !- CoordinateSystem


"""


    eplustxt = snippet1 + zonestxt + snippet2 + wallstxt + windowstxt
    eplustxt = eplustxt.replace('\n', '\r\n')
    return eplustxt