當前位置: 首頁>>代碼示例>>Python>>正文


Python EnKFMain.free方法代碼示例

本文整理匯總了Python中ert.enkf.enkf_main.EnKFMain.free方法的典型用法代碼示例。如果您正苦於以下問題:Python EnKFMain.free方法的具體用法?Python EnKFMain.free怎麽用?Python EnKFMain.free使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ert.enkf.enkf_main.EnKFMain的用法示例。


在下文中一共展示了EnKFMain.free方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_repr

# 需要導入模塊: from ert.enkf.enkf_main import EnKFMain [as 別名]
# 或者: from ert.enkf.enkf_main.EnKFMain import free [as 別名]
 def test_repr( self ):
     with TestAreaContext("enkf_test", store_area=True) as work_area:
         work_area.copy_directory(self.case_directory)
         main = EnKFMain("simple_config/minimum_config")
         pfx = 'EnKFMain(ensemble_size'
         self.assertEqual(pfx, repr(main)[:len(pfx)])
         main.free()
開發者ID:Ensembles,項目名稱:ert,代碼行數:9,代碼來源:test_enkf.py

示例2: test_observations

# 需要導入模塊: from ert.enkf.enkf_main import EnKFMain [as 別名]
# 或者: from ert.enkf.enkf_main.EnKFMain import free [as 別名]
    def test_observations(self):
        with TestAreaContext("enkf_test") as work_area:
            work_area.copy_directory(self.case_directory)

            main = EnKFMain("simple_config/minimum_config")

            count = 10
            summary_key = "test_key"
            observation_key = "test_obs_key"
            summary_observation_node = EnkfConfigNode.createSummaryConfigNode(summary_key, LoadFailTypeEnum.LOAD_FAIL_EXIT)
            observation_vector = ObsVector(EnkfObservationImplementationType.SUMMARY_OBS, observation_key, summary_observation_node, count)

            main.getObservations().addObservationVector(observation_vector)

            values = []
            for index in range(0, count):
                value = index * 10.5
                std = index / 10.0
                summary_observation_node = SummaryObservation(summary_key, observation_key, value, std)
                observation_vector.installNode(index, summary_observation_node)
                self.assertEqual(observation_vector.getNode(index), summary_observation_node)
                self.assertEqual(value, summary_observation_node.getValue())
                values.append((index, value, std))
            


            observations = main.getObservations()
            test_vector = observations[observation_key]
            index = 0
            for node in test_vector:
                self.assertTrue( isinstance( node , SummaryObservation ))
                self.assertEqual( node.getValue( ) , index * 10.5 )
                index += 1

                
            self.assertEqual(observation_vector, test_vector)
            for index, value, std in values:
                self.assertTrue(test_vector.isActive(index))

                summary_observation_node = test_vector.getNode(index)
                """@type: SummaryObservation"""

                self.assertEqual(value, summary_observation_node.getValue())
                self.assertEqual(std, summary_observation_node.getStandardDeviation())
                self.assertEqual(summary_key, summary_observation_node.getSummaryKey())


            main.free()
開發者ID:,項目名稱:,代碼行數:50,代碼來源:

示例3: test_ecl_config_creation

# 需要導入模塊: from ert.enkf.enkf_main import EnKFMain [as 別名]
# 或者: from ert.enkf.enkf_main.EnKFMain import free [as 別名]
    def test_ecl_config_creation(self):
        with TestAreaContext("enkf_library_test") as work_area:
            work_area.copy_directory(self.case_directory)

            main = EnKFMain("simple_config/minimum_config", self.site_config)

            self.assertIsInstance(main.analysisConfig(), AnalysisConfig)
            self.assertIsInstance(main.eclConfig(), EclConfig)

            with self.assertRaises(ValueError): # Null pointer!
                self.assertIsInstance(main.eclConfig().getRefcase(), EclSum)

            file_system = main.getEnkfFsManager().getCurrentFileSystem()
            self.assertEqual(file_system.getCaseName(), "default")
            time_map = file_system.getTimeMap()
            self.assertIsInstance(time_map, TimeMap)

            main.free()
開發者ID:patricknraanes,項目名稱:ert,代碼行數:20,代碼來源:test_enkf_library.py

示例4: test_config

# 需要導入模塊: from ert.enkf.enkf_main import EnKFMain [as 別名]
# 或者: from ert.enkf.enkf_main.EnKFMain import free [as 別名]
    def test_config( self ):
        with TestAreaContext("enkf_test") as work_area:
            work_area.copy_directory(self.case_directory)

            main = EnKFMain("simple_config/minimum_config", self.site_config_file)

            self.assertIsInstance(main.ensembleConfig(), EnsConfig)
            self.assertIsInstance(main.analysisConfig(), AnalysisConfig)
            self.assertIsInstance(main.getModelConfig(), ModelConfig)
            #self.assertIsInstance(main.local_config(), LocalConfig) #warn: Should this be None?
            self.assertIsInstance(main.siteConfig(), SiteConfig)
            self.assertIsInstance(main.eclConfig(), EclConfig)
            self.assertIsInstance(main.plot_config(), PlotConfig)

            # self.main.load_obs(obs_config_file)
            self.assertIsInstance(main.getObservations(), EnkfObs)
            self.assertIsInstance(main.get_templates(), ErtTemplates)
            self.assertIsInstance(main.getEnkfFsManager().getFileSystem(), EnkfFs)
            # self.assertIsInstance(main.iget_member_config(0), MemberConfig)
            self.assertIsInstance(main.getMemberRunningState(0), EnKFState)

            main.free()
開發者ID:blattms,項目名稱:ert,代碼行數:24,代碼來源:test_enkf.py

示例5: test_bootstrap

# 需要導入模塊: from ert.enkf.enkf_main import EnKFMain [as 別名]
# 或者: from ert.enkf.enkf_main.EnKFMain import free [as 別名]
 def test_bootstrap( self ):
     with TestAreaContext("enkf_test", store_area=True) as work_area:
         work_area.copy_directory(self.case_directory)
         main = EnKFMain("simple_config/minimum_config", self.site_config_file)
         self.assertTrue(main, "Load failed")
         main.free()
開發者ID:blattms,項目名稱:ert,代碼行數:8,代碼來源:test_enkf.py


注:本文中的ert.enkf.enkf_main.EnKFMain.free方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。