当前位置: 首页>>代码示例>>Python>>正文


Python EclSum.fwrite方法代码示例

本文整理汇总了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())
开发者ID:OPM,项目名称:ResInsight,代码行数:12,代码来源:test_sum_statoil.py

示例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())
                        )
开发者ID:OPM,项目名称:ResInsight,代码行数:20,代码来源:test_sum_statoil.py

示例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( )
开发者ID:OPM,项目名称:ResInsight,代码行数:8,代码来源:test_sum.py

示例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)
开发者ID:OPM,项目名称:ResInsight,代码行数:7,代码来源:test_sum_statoil.py

示例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 ):
开发者ID:,项目名称:,代码行数:70,代码来源:


注:本文中的ecl.summary.EclSum.fwrite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。