本文整理汇总了Python中ecl.summary.EclSum.fwrite方法的典型用法代码示例。如果您正苦于以下问题:Python EclSum.fwrite方法的具体用法?Python EclSum.fwrite怎么用?Python EclSum.fwrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecl.summary.EclSum
的用法示例。
在下文中一共展示了EclSum.fwrite方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_write
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import fwrite [as 别名]
def test_write(self):
with TestAreaContext("my_space") as area:
intersect_summary = EclSum( self.createTestPath( "Statoil/ECLIPSE/SummaryRestart/iter-1/NOR-2013A_R007-0"), lazy_load=False )
self.assertIsNotNone(intersect_summary)
write_location = os.path.join(os.getcwd(), "CASE")
intersect_summary.fwrite(ecl_case=write_location)
reloaded_summary = EclSum(write_location)
self.assertEqual(intersect_summary.keys(), reloaded_summary.keys())
示例2: test_ix_write
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import fwrite [as 别名]
def test_ix_write(self):
for data_set in [
"Statoil/ECLIPSE/ix/summary/CREATE_REGION_AROUND_WELL",
"Statoil/ECLIPSE/ix/troll/IX_NOPH3_R04_75X75X1_GRID2.SMSPEC"
]:
with TestAreaContext("my_space" + data_set.split("/")[-1]) as area:
intersect_summary = EclSum(self.createTestPath(data_set), lazy_load=False)
self.assertIsNotNone(intersect_summary)
write_location = os.path.join(os.getcwd(), "CASE")
intersect_summary.fwrite(ecl_case=write_location)
reloaded_summary = EclSum(write_location)
self.assertEqual(
list(intersect_summary.keys()),
list(reloaded_summary.keys())
)
示例3: test_write_not_implemented
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import fwrite [as 别名]
def test_write_not_implemented(self):
path = os.path.join(self.TESTDATA_ROOT, "local/ECLIPSE/cp_simple3/SIMPLE_SUMMARY3")
case = EclSum( path, lazy_load=True )
self.assertFalse(case.can_write())
with self.assertRaises(NotImplementedError):
case.fwrite( )
示例4: test_fwrite
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import fwrite [as 别名]
def test_fwrite(self):
ecl_sum = EclSum(self.case, lazy_load=False)
with TestAreaContext("python/sum-test/fwrite") as work_area:
ecl_sum.fwrite(ecl_case="CASE")
self.assertTrue(True)
示例5: SumTest
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import fwrite [as 别名]
#.........这里部分代码省略.........
def test_keys(self):
sum = self.ecl_sum
self.assertRaises(KeyError, sum.__getitem__, "BJARNE")
v = sum["FOPT"]
self.assertEqual(len(v), 63)
def test_index(self):
sum = self.ecl_sum
index = sum.get_key_index("TCPUDAY")
self.assertEqual(index, 10239)
def test_report(self):
sum = self.ecl_sum
self.assertEqual(sum.get_report(date=datetime.date(2000, 10, 1)), 10)
self.assertEqual(sum.get_report(date=datetime.date(2000, 10, 3)), -1)
self.assertEqual(sum.get_report(date=datetime.date(1980, 10, 3)), -1)
self.assertEqual(sum.get_report(date=datetime.date(2012, 10, 3)), -1)
self.assertEqual(sum.get_report(days=91), 3)
self.assertEqual(sum.get_report(days=92), -1)
self.assertAlmostEqual(sum.get_interp("FOPT", days=91), sum.get_from_report("FOPT", 3))
self.assertEqual(sum.first_report, 1)
self.assertEqual(sum.last_report, 62)
self.assertEqual(sum.get_report_time(10), datetime.date(2000, 10, 1))
self.assertFloatEqual(sum.get_from_report("FOPT", 10), 6.67447e+06)
@skipIf(EclTest.slowTestShouldNotRun(), "Slow test skipped")
def test_fwrite(self):
# todo: What is tested here?
# work_area = TestArea("python/sum-test/fwrite", True)
with TestAreaContext("python/sum-test/fwrite") as work_area:
self.ecl_sum.fwrite(ecl_case="CASE")
self.assertTrue(True)
def test_block(self):
sum = self.ecl_sum
index_ijk = sum.get_key_index("BPR:15,28,1")
index_num = sum.get_key_index("BPR:1095")
self.assertEqual(index_ijk, index_num)
def test_restart(self):
hist = EclSum(self.createTestPath("Statoil/ECLIPSE/sum-restart/history/T07-4A-W2011-18-P1"))
base = EclSum(self.createTestPath("Statoil/ECLIPSE/sum-restart/prediction/BASECASE"))
pred = EclSum(self.createTestPath("Statoil/ECLIPSE/sum-restart/prediction/BASECASE"), include_restart=False)
self.assertIsNotNone(hist)
self.assertIsNotNone(base)
self.assertIsNotNone(pred)
def test_case1(self ):
self.assertTrue(self.ecl_sum.path == self.createTestPath(path))
self.assertTrue(self.ecl_sum.base == base)
self.assertTrue(self.ecl_sum.case == self.createTestPath(case))
self.assertTrue(self.ecl_sum.abs_path == self.createTestPath(path))
def test_case2( self ):