本文整理汇总了Python中eppy.modeleditor.IDF.idfstr方法的典型用法代码示例。如果您正苦于以下问题:Python IDF.idfstr方法的具体用法?Python IDF.idfstr怎么用?Python IDF.idfstr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eppy.modeleditor.IDF
的用法示例。
在下文中一共展示了IDF.idfstr方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_glazeddoor
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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()
示例2: test_wallunderground
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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_window
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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()
示例4: test_door
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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()
示例5: test_floorinterzone
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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()
示例6: test_floorgroundcontact
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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()
示例7: test_ceilingadiabatic
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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()
示例8: test_roof
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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()
示例9: idfreadtest
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [as 别名]
def idfreadtest(iddhandle, idfhandle1, idfhandle2, verbose=False, save=False):
"""compare the results of eppy reader and simple reader"""
# read using eppy:
try:
IDF.setiddname(iddhandle)
except modeleditor.IDDAlreadySetError:
# idd has already been set
pass
idf = IDF(idfhandle1)
idfstr = idf.idfstr()
idfstr = idf2txt(idfstr)
# -
# do a simple read
simpletxt = idfhandle2.read()
try:
simpletxt = simpletxt.decode('ISO-8859-2')
except AttributeError:
pass
simpletxt = idf2txt(simpletxt)
# -
if save:
open('simpleread.idf', 'w').write(idfstr)
open('eppyread.idf', 'w').write(simpletxt)
# do the compare
lines1 = idfstr.splitlines()
lines2 = simpletxt.splitlines()
for i, (line1, line2) in enumerate(zip(lines1, lines2)):
if line1 != line2:
# test if it is a mismatch in number format
try:
line1 = float(line1[:-1])
line2 = float(line2[:-1])
if line1 != line2:
if verbose:
print()
print("%s- : %s" % (i, line1))
print("%s- : %s" % (i, line2))
return False
except ValueError:
if verbose:
print()
print("%s- : %s" % (i, line1))
print("%s- : %s" % (i, line2))
return False
return True
示例10: test_idfstr
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import idfstr [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