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
def test_inch2meters(): """py.test for inch2meters()""" data = Inch2Meters_Data assert readsketchup.inch2meters(data.dct) == data.meters_dct