added basic tables support, and cornerpoint test data (#27)

* added basic tables support, and cornerpoint test data
This commit is contained in:
Pål Grønås Drange
2017-02-16 15:43:59 +01:00
committed by GitHub
parent 7a6fff51ca
commit d966376562
5 changed files with 1236 additions and 0 deletions

View File

@@ -37,6 +37,13 @@ class Eclipse3DProperties(object):
return 'Eclipse3DProperties()'
@delegate(lib.Tables)
class Tables(object):
def __repr__(self):
return 'Tables()'
@delegate(lib.EclipseGrid)
class EclipseGrid(object):

View File

@@ -262,6 +262,7 @@ py::class_< EclipseState >( "EclipseState", py::no_init )
.def( "_props", &EclipseState::get3DProperties, ref() )
.def( "_grid", &EclipseState::getInputGrid, ref() )
.def( "_cfg", &EclipseState::cfg, ref() )
.def( "tables", &EclipseState::getTableManager, ref() )
.def( "has_input_nnc", &EclipseState::hasInputNNC )
.def( "input_nnc", state::getNNC )
.def( "faultNames", state::faultNames )
@@ -283,6 +284,10 @@ py::class_< Eclipse3DProperties >( "Eclipse3DProperties", py::no_init )
.def( "__getitem__", props::getitem )
;
py::class_< TableManager >( "Tables", py::no_init )
.def( "__contains__", &TableManager::hasTables )
;
/*
* config
*/

View File

@@ -1,4 +1,5 @@
configure_file(spe3/SPE3CASE1.DATA spe3/SPE3CASE1.DATA COPYONLY)
configure_file(data/CORNERPOINT_ACTNUM.DATA data/CORNERPOINT_ACTNUM.DATA COPYONLY)
configure_file(data/JFUNC.DATA data/JFUNC.DATA COPYONLY)
foreach(prog parse state props schedule wells)

File diff suppressed because it is too large Load Diff

View File

@@ -52,7 +52,9 @@ SATNUM
def setUp(self):
if self.spe3 is None:
self.spe3 = sunbeam.parse('spe3/SPE3CASE1.DATA')
self.cpa = sunbeam.parse('data/CORNERPOINT_ACTNUM.DATA')
self.state = self.spe3
self.cp_state = self.cpa
def test_repr_title(self):
self.assertTrue('EclipseState' in repr(self.state))
@@ -96,6 +98,17 @@ SATNUM
self.assertTrue(sim.hasDISGAS())
self.assertTrue(sim.hasVAPOIL())
def test_tables(self):
tables = self.spe3.tables()
self.assertTrue('SGOF' in tables)
self.assertTrue('SWOF' in tables)
self.assertFalse('SOF' in tables)
ct = self.cp_state.tables()
self.assertFalse('SGOF' in ct)
self.assertTrue('SWOF' in ct)
def test_faults(self):
self.assertEquals([], self.spe3.faultNames())
self.assertEquals({}, self.spe3.faults())