本文整理匯總了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 )