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


Python EclSum.keys方法代码示例

本文整理汇总了Python中ert.ecl.EclSum.keys方法的典型用法代码示例。如果您正苦于以下问题:Python EclSum.keys方法的具体用法?Python EclSum.keys怎么用?Python EclSum.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ert.ecl.EclSum的用法示例。


在下文中一共展示了EclSum.keys方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_segment

# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import keys [as 别名]
 def test_segment(self):
     sum = EclSum(self.createTestPath("Statoil/ECLIPSE/Oseberg/F8MLT/F8MLT-F4"))
     segment_vars = sum.keys("SOFR:F-8:*")
     self.assertIn("SOFR:F-8:1", segment_vars)
     for var in segment_vars:
         tmp = var.split(":")
         nr = int(tmp[2])
         self.assertTrue(nr >= 0)
开发者ID:agchitu,项目名称:ert,代码行数:10,代码来源:test_sum_statoil.py

示例2: test_Heidrun

# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import keys [as 别名]
    def test_Heidrun(self):
        sum = EclSum( self.createTestPath("Statoil/ECLIPSE/Heidrun/Summary/FF12_2013B3_CLEAN_RS"))
        self.assertEqual( 452 , len(sum))
        self.assertFloatEqual( 1.8533144e+8 , sum.get_last_value("FOPT"))

        trange = sum.timeRange( start = datetime.date( 2015 , 1 , 1), interval = "1M")
        self.assertTrue( trange[0] == datetime.date( 2016 , 2 , 1 ))
        for t in trange:
            sum.get_interp( "FOPT" , date = t )
        

        with TestAreaContext("csv/export"):
            sum.exportCSV("file.csv")
            input_file = csv.DictReader( open("file.csv"))
            for row in input_file:
                keys = sum.keys( pattern = "W*")
                keys |= sum.keys( pattern = "G")
                
                for key in keys:
                    self.assertTrue( key in row )
                break
开发者ID:Thif,项目名称:ert-1,代码行数:23,代码来源:test_sum_statoil.py

示例3: test_restart_mapping

# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import keys [as 别名]
    def test_restart_mapping(self):
        history = EclSum( self.createTestPath( "Statoil/ECLIPSE/SummaryRestart/iter-1/NOR-2013A_R007-0") )
        total = EclSum( self.createTestPath( "Statoil/ECLIPSE/SummaryRestart/Prediction/NOR-2013A_R007_PRED-0") , include_restart = True)

        history_dates = history.get_dates( )
        total_dates = total.get_dates( )
        for i in range(len(history_dates)):
            self.assertEqual( history_dates[i] , total_dates[i] )

            
        keys = history.keys( pattern = "W*")
        for key in keys:
            if key in total:
                self.assertEqual( history.iget( key , 5 ) , total.iget( key , 5 ))

        self.assertFalse( "WGPR:NOT_21_D" in history )
        self.assertTrue( "WGPR:NOT_21_D" in total )

        self.assertEqual( total.iget( "WGPR:NOT_21_D", 5) , 0) # Default value
开发者ID:Ensembles,项目名称:ert,代码行数:21,代码来源:test_sum_statoil.py

示例4: EclSumVectorTest

# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import keys [as 别名]
class EclSumVectorTest(ExtendedTestCase):
    def setUp(self):
        self.test_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.SMSPEC")
        self.ecl_sum = EclSum(self.test_file)

    def test_reportOnly_warns(self):
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter("always")

            vector = EclSumVector(self.ecl_sum, "FOPT", True)
            assert len(w) == 1
            assert issubclass(w[-1].category, DeprecationWarning)

    def test_basic(self):
        self.assertEqual(512, len(self.ecl_sum.keys()))
        pfx = "EclSum(name"
        self.assertEqual(pfx, repr(self.ecl_sum)[: len(pfx)])
        it = iter(self.ecl_sum)
        t = self.ecl_sum[it.next()]  # EclSumVector
        self.assertEqual(63, len(t))
        self.assertEqual("BARSA", t.unit)
        pfx = "EclSumVector(key = "
        self.assertEqual(pfx, repr(t)[: len(pfx)])
开发者ID:Ensembles,项目名称:ert,代码行数:25,代码来源:test_ecl_sum_vector.py


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