本文整理汇总了Python中eppy.modeleditor.IDF.initreadtxt方法的典型用法代码示例。如果您正苦于以下问题:Python IDF.initreadtxt方法的具体用法?Python IDF.initreadtxt怎么用?Python IDF.initreadtxt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eppy.modeleditor.IDF
的用法示例。
在下文中一共展示了IDF.initreadtxt方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_initread
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_initread():
"""Test for IDF.initread() with filename in unicode and as python str.
"""
# setup
idf = IDF()
idf.initreadtxt(idfsnippet)
idf.saveas('tmp.idf')
# test fname as unicode
fname = 'tmp.idf'
assert isinstance(fname, string_types)
idf = IDF()
idf.initread(fname)
assert idf.getobject('BUILDING', 'Building')
# test fname as str
fname = str('tmp.idf')
assert isinstance(fname, string_types)
idf = IDF()
idf.initread(fname)
assert idf.getobject('BUILDING', 'Building')
# test that a nonexistent file raises an IOError
fname = "notarealfilename.notreal"
idf = IDF()
try:
idf.initread(fname)
assert False # shouldn't reach here
except IOError:
pass
# teardown
os.remove('tmp.idf')
示例2: test_wallunderground
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_wallunderground():
"""py.test for wallunderground"""
bsdtxt = """BuildingSurface:Detailed, WALL-1PF, WALL, WALL-1, PLENUM-1,
Ground, , SunExposed, WindExposed, 0.5, 4, 0.0, 0.0, 3.0, 0.0, 0.0, 2.4,
30.5, 0.0, 2.4, 30.5, 0.0, 3.0;
"""
simpleobjtxt = """WALL:UNDERGROUND, WALL-1PF, WALL-1, PLENUM-1, 180.0,
90.0, 0, 0, 0, 30.5, 0.6;"""
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.wallunderground(
idf, bsd, deletebsd=False,
setto000=True)
newidttxt = bsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.wallunderground(
idf, bsd, deletebsd=True,
setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例3: test_door
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_door():
"""py.test for window"""
fsdtxt = """FenestrationSurface:Detailed, WR-1, door, Dbl Clr 3mm/13mm Air,
RIGHT-1, , 0.5, , , 1, 4, 30.5, 3.8, 2.1, 30.5, 3.8, 0.9, 30.5, 11.4, 0.9,
30.5, 11.4, 2.1;"""
simpleobjtxt = """DOOR, WR-1, Dbl Clr 3mm/13mm Air, RIGHT-1, 1, 0, 0, 7.6,
1.2;"""
idf = IDF()
idf.initreadtxt(fsdtxt)
fsd = idf.idfobjects["FenestrationSurface:Detailed".upper()][0]
w_ext = simplesurface.door(idf, fsd, deletebsd=False, setto000=True)
newidttxt = fsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(fsdtxt)
fsd = idf.idfobjects["FenestrationSurface:Detailed".upper()][0]
w_ext = simplesurface.door(idf, fsd, deletebsd=True, setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例4: test_glazeddoor
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_glazeddoor():
"""py.test for glazeddoor"""
fsdtxt = """FenestrationSurface:Detailed, DF-1, GLASSDOOR, Sgl Grey 3mm,
FRONT-1, , 0.5, , , 1, 4, 21.3, 0.0, 2.1, 21.3, 0.0, 0.0, 23.8, 0.0, 0.0,
23.8, 0.0, 2.1;"""
simpleobjtxt = """GLAZEDDOOR, DF-1, Sgl Grey 3mm, FRONT-1, , , 1, 0, 0,
2.5, 2.1;"""
idf = IDF()
idf.initreadtxt(fsdtxt)
fsd = idf.idfobjects["FenestrationSurface:Detailed".upper()][0]
w_ext = simplesurface.glazeddoor(idf, fsd, deletebsd=False, setto000=True)
newidttxt = fsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(fsdtxt)
fsd = idf.idfobjects["FenestrationSurface:Detailed".upper()][0]
w_ext = simplesurface.glazeddoor(idf, fsd, deletebsd=True, setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例5: test_window
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_window():
"""py.test for window"""
fsdtxt = """FenestrationSurface:Detailed, WF-1, WINDOW,
Dbl Clr 3mm/13mm Air, FRONT-1, , 0.5, , , 1, 4, 3.0, 0.0, 2.1, 3.0, 0.0,
0.9, 16.8, 0.0,
0.9, 16.8, 0.0, 2.1;"""
simpleobjtxt = """WINDOW, WF-1, Dbl Clr 3mm/13mm Air, FRONT-1, , , 1, 0, 0,
13.8, 1.2;"""
idf = IDF()
idf.initreadtxt(fsdtxt)
fsd = idf.idfobjects["FenestrationSurface:Detailed".upper()][0]
w_ext = simplesurface.window(idf, fsd, deletebsd=False, setto000=True)
newidttxt = fsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(fsdtxt)
fsd = idf.idfobjects["FenestrationSurface:Detailed".upper()][0]
w_ext = simplesurface.window(idf, fsd, deletebsd=True, setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例6: test_floorinterzone
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_floorinterzone():
"""py.test for floorinterzone"""
bsdtxt = """BuildingSurface:Detailed, WALL-1PF, floor, WALL-1, PLENUM-1,
Zone, gumby, SunExposed, WindExposed, 0.5, 4, 0.0, 0.0, 3.0, 0.0, 0.0, 2.4,
30.5, 0.0, 2.4, 30.5, 0.0, 3.0;
"""
simpleobjtxt = """FLOOR:INTERZONE, WALL-1PF, WALL-1, PLENUM-1, gumby,
180.0, 90.0, 0, 0, 0, 30.5, 0.6;"""
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.floorinterzone(
idf, bsd, deletebsd=False,
setto000=True)
newidttxt = bsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.floorinterzone(
idf, bsd, deletebsd=True,
setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例7: test_floorgroundcontact
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_floorgroundcontact():
"""py.test for floorgroundcontact"""
bsdtxt = """BuildingSurface:Detailed, WALL-1PF, floor, WALL-1, PLENUM-1,
Ground, , SunExposed, WindExposed, 0.5, 4, 0.0, 0.0, 3.0, 0.0, 0.0, 2.4,
30.5, 0.0, 2.4, 30.5, 0.0, 3.0;
"""
simpleobjtxt = """FLOOR:GROUNDCONTACT, WALL-1PF, WALL-1, PLENUM-1, 180.0,
90.0, 0, 0, 0, 30.5, 0.6;"""
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.floorgroundcontact(
idf, bsd, deletebsd=False,
setto000=True)
newidttxt = bsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.floorgroundcontact(
idf, bsd, deletebsd=True,
setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例8: test_ceilingadiabatic
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_ceilingadiabatic():
"""py.test for ceilingadiabatic"""
bsdtxt = """BuildingSurface:Detailed, WALL-1PF, ceiling, WALL-1, PLENUM-1,
Adiabatic, , SunExposed, WindExposed, 0.5, 4, 0.0, 0.0, 3.0, 0.0, 0.0, 2.4,
30.5, 0.0, 2.4, 30.5, 0.0, 3.0;
"""
simpleobjtxt = """CEILING:ADIABATIC, WALL-1PF, WALL-1, PLENUM-1, 180.0,
90.0, 0, 0, 0, 30.5, 0.6;"""
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.ceilingadiabatic(
idf, bsd, deletebsd=False,
setto000=True)
newidttxt = bsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.ceilingadiabatic(
idf, bsd, deletebsd=True,
setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例9: test_roof
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_roof():
"""py.test for roof"""
bsdtxt = """BuildingSurface:Detailed, WALL-1PF, roof, WALL-1, PLENUM-1, , ,
SunExposed, WindExposed, 0.5, 4, 0.0, 0.0, 3.0, 0.0, 0.0, 2.4, 30.5, 0.0,
2.4, 30.5, 0.0, 3.0;
"""
simpleobjtxt = """ROOF, WALL-1PF, WALL-1, PLENUM-1, 180.0, 90.0, 0, 0, 0, 30.5, 0.6;"""
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.roof(idf, bsd, deletebsd=False, setto000=True)
newidttxt = bsdtxt + simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
# test for deletebsd = True
idf = IDF()
idf.initreadtxt(bsdtxt)
bsd = idf.idfobjects["BuildingSurface:Detailed".upper()][0]
w_ext = simplesurface.roof(idf, bsd, deletebsd=True, setto000=True)
newidttxt = simpleobjtxt
newidf = IDF()
newidf.initreadtxt(newidttxt)
assert idf.idfstr() == newidf.idfstr()
示例10: test_idfstr
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_idfstr():
"""Test all outputtype options in IDF.idfstr().
"""
idf = IDF()
idf.initreadtxt(idfsnippet)
assert idf.outputtype == 'standard' # start with the default
original = idf.idfstr()
assert "!-" in original # has comment
assert "\n" in original # has line break
assert "\n\n" in original # has empty line
idf.outputtype = 'standard'
s = idf.idfstr()
assert "!-" in s # has comment
assert "\n" in s # has line break
assert "\n\n" in s # has empty line
assert s == original # is unchanged
idf.outputtype = 'nocomment'
s = idf.idfstr()
assert "!-" not in s # has no comments
assert "\n" in s # has line break
assert "\n\n" in s # has empty line
assert s != original # is changed
idf.outputtype = 'nocomment1'
s = idf.idfstr()
assert "!-" not in s # has no comments
assert "\n" in s # has line break
assert "\n\n" in s # has empty lines
assert s != original # is changed
idf.outputtype = 'nocomment2'
s = idf.idfstr()
assert "!-" not in s # has no comments
assert "\n" in s # has line break
assert "\n\n" not in s # has no empty lines
assert s != original # is changed
idf.outputtype = 'compressed'
s = idf.idfstr()
assert "!-" not in s # has no comments
assert "\n" not in s # has no line breaks
assert "\n\n" not in s # has no empty lines
assert s != original # is changed
示例11: test_initreadtxt
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
def test_initreadtxt():
"""Test for IDF.initreadtxt().
"""
idftxt = """
Material,
G01a 19mm gypsum board, !- Name
MediumSmooth, !- Roughness
0.019, !- Thickness {m}
0.16, !- Conductivity {W/m-K}
800, !- Density {kg/m3}
1090; !- Specific Heat {J/kg-K}
Construction,
Interior Wall, !- Name
G01a 19mm gypsum board, !- Outside Layer
F04 Wall air space resistance, !- Layer 2
G01a 19mm gypsum board; !- Layer 3
"""
idf = IDF()
idf.initreadtxt(idftxt)
assert idf.getobject('MATERIAL', 'G01a 19mm gypsum board')
示例12: IDF
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initreadtxt [as 别名]
BuildingSurface:Detailed,
z2 Roof 0001, !- Name
Roof, !- Surface Type
, !- Construction Name
Thermal Zone 2, !- Zone Name
Outdoors, !- Outside Boundary Condition
, !- Outside Boundary Condition Object
SunExposed, !- Sun Exposure
WindExposed, !- Wind Exposure
, !- View Factor to Ground
, !- Number of Vertices
0.0, !- Vertex 1 Xcoordinate
0.0, !- Vertex 1 Ycoordinate
1.458, !- Vertex 1 Zcoordinate
0.0, !- Vertex 2 Xcoordinate
2.9, !- Vertex 2 Ycoordinate
1.458, !- Vertex 2 Zcoordinate
-2.14, !- Vertex 3 Xcoordinate
2.9, !- Vertex 3 Ycoordinate
1.458, !- Vertex 3 Zcoordinate
-2.14, !- Vertex 4 Xcoordinate
0.0, !- Vertex 4 Ycoordinate
1.458; !- Vertex 4 Zcoordinate
"""
idf = IDF()
idf.initreadtxt(idftxt)
idf.outputtype = 'compressed'
idf.printidf()