本文整理汇总了Python中ecl.summary.EclSum.load方法的典型用法代码示例。如果您正苦于以下问题:Python EclSum.load方法的具体用法?Python EclSum.load怎么用?Python EclSum.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecl.summary.EclSum
的用法示例。
在下文中一共展示了EclSum.load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_invalid
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import load [as 别名]
def test_invalid(self):
case = create_case()
with TestAreaContext("sum_invalid"):
case.fwrite( )
with open("CASE.txt", "w") as f:
f.write("No - this is not EclKW file ....")
with self.assertRaises( IOError ):
case2 = EclSum.load( "CSV.SMSPEC" , "CASE.txt" )
with self.assertRaises( IOError ):
case2 = EclSum.load( "CASE.txt" , "CSV.UNSMRY" )
kw1 = EclKW("TEST1", 30, EclDataType.ECL_INT)
kw2 = EclKW("TEST2", 30, EclDataType.ECL_INT)
with openFortIO( "CASE.KW" , FortIO.WRITE_MODE) as f:
kw1.fwrite( f )
kw2.fwrite( f )
with self.assertRaises( IOError ):
case2 = EclSum.load( "CSV.SMSPEC" , "CASE.KW")
with self.assertRaises( IOError ):
case2 = EclSum.load( "CASE.KW" , "CSV.UNSMRY" )
示例2: test_different_names
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import load [as 别名]
def test_different_names(self):
case = create_case()
with TestAreaContext("sum_different"):
case.fwrite( )
shutil.move("CSV.SMSPEC" , "CSVX.SMSPEC")
with self.assertRaises(IOError):
case2 = EclSum.load( "Does/not/exist" , "CSV.UNSMRY")
with self.assertRaises(IOError):
case2 = EclSum.load( "CSVX.SMSPEC" , "CSVX.UNSMRY")
case2 = EclSum.load( "CSVX.SMSPEC" , "CSV.UNSMRY" )
self.assert_solve( case2 )
self.assertEqual(case.unit("FOPR"), "SM3/DAY")