本文整理汇总了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()
示例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()
示例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()
示例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()
示例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()