本文整理汇总了Python中ert.ecl.FortIO.isFortranFile方法的典型用法代码示例。如果您正苦于以下问题:Python FortIO.isFortranFile方法的具体用法?Python FortIO.isFortranFile怎么用?Python FortIO.isFortranFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ert.ecl.FortIO
的用法示例。
在下文中一共展示了FortIO.isFortranFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_fortran_file
# 需要导入模块: from ert.ecl import FortIO [as 别名]
# 或者: from ert.ecl.FortIO import isFortranFile [as 别名]
def test_is_fortran_file(self):
with TestAreaContext("python/fortio/guess"):
kw1 = EclKW("KW" , 12345 , EclDataType.ECL_FLOAT)
with openFortIO("fortran_file" , mode = FortIO.WRITE_MODE) as f:
kw1.fwrite( f )
with open("text_file" , "w") as f:
kw1.write_grdecl( f )
self.assertTrue( FortIO.isFortranFile( "fortran_file" ))
self.assertFalse( FortIO.isFortranFile( "text_file" ))
示例2: loadFromFile
# 需要导入模块: from ert.ecl import FortIO [as 别名]
# 或者: from ert.ecl.FortIO import isFortranFile [as 别名]
def loadFromFile(cls , filename):
"""
Will inspect the @filename argument and create a new EclGrid instance.
"""
if FortIO.isFortranFile( filename ):
return EclGrid( filename )
else:
return EclGrid.loadFromGrdecl( filename )