本文整理汇总了Python中ert.ecl.FortIO.writer方法的典型用法代码示例。如果您正苦于以下问题:Python FortIO.writer方法的具体用法?Python FortIO.writer怎么用?Python FortIO.writer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ert.ecl.FortIO
的用法示例。
在下文中一共展示了FortIO.writer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_kw
# 需要导入模块: from ert.ecl import FortIO [as 别名]
# 或者: from ert.ecl.FortIO import writer [as 别名]
def test_kw(self):
kw1 = EclKW.create("KW1", 2, EclTypeEnum.ECL_INT_TYPE)
kw2 = EclKW.create("KW2", 2, EclTypeEnum.ECL_INT_TYPE)
kw1[0] = 99
kw1[1] = 77
kw2[0] = 113
kw2[1] = 335
with TestAreaContext("python/fortio/write-kw"):
f = FortIO.writer("test", fmt_file=False)
kw1.fwrite(f)
f.close()
f = FortIO.open("test", mode="a")
kw2.fwrite(f)
f.close()
f = FortIO.open("test", fmt_file=False)
k1 = EclKW.fread(f)
k2 = EclKW.fread(f)
f.close()
self.assertTrue(k1.equal(kw1))
self.assertTrue(k2.equal(kw2))
示例2: test_fwrite
# 需要导入模块: from ert.ecl import FortIO [as 别名]
# 或者: from ert.ecl.FortIO import writer [as 别名]
def test_fwrite( self ):
#work_area = TestArea("python/ecl_file/fwrite")
with TestAreaContext("python/ecl_file/fwrite"):
rst_file = EclFile(self.test_file)
fortio = FortIO.writer("ECLIPSE.UNRST")
rst_file.fwrite(fortio)
fortio.close()
rst_file.close()
self.assertFilesAreEqual("ECLIPSE.UNRST", self.test_file)
示例3: test_open_write
# 需要导入模块: from ert.ecl import FortIO [as 别名]
# 或者: from ert.ecl.FortIO import writer [as 别名]
def test_open_write(self):
with TestAreaContext("python/fortio/write"):
f = FortIO.writer("newfile")
f.close()
self.assertTrue(True)