Add vfp_table_nr to Group
VFP table nr is added from GRUPNET for further use related to GroupTree in Webportalen
This commit is contained in:
@@ -131,6 +131,11 @@ class Group(object):
|
||||
names = self._wellnames(self.timestep)
|
||||
return [w for w in self._schedule.wells if w.name in names]
|
||||
|
||||
@property
|
||||
def vfp_table_nr(self):
|
||||
vfp_table_nr = self._vfp_table_nr(self.timestep)
|
||||
return vfp_table_nr
|
||||
|
||||
@property
|
||||
def parent(self):
|
||||
par = self._schedule._group_tree(self.timestep)._parent(self.name)
|
||||
|
||||
@@ -8,12 +8,17 @@ namespace {
|
||||
const std::set<std::string> wellnames( const Group& g, size_t timestep ) {
|
||||
return g.getWells( timestep );
|
||||
}
|
||||
|
||||
int get_vfp_table_nr( const Group& g, size_t timestep ) {
|
||||
return g.getGroupNetVFPTable(timestep);
|
||||
}
|
||||
}
|
||||
|
||||
void sunbeam::export_Group(py::module& module) {
|
||||
|
||||
py::class_< Group >( module, "Group")
|
||||
.def_property_readonly( "name", &Group::name)
|
||||
.def( "_vfp_table_nr", &get_vfp_table_nr )
|
||||
.def( "_wellnames", &wellnames );
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ configure_file(data/CORNERPOINT_ACTNUM.DATA data/CORNERPOINT_ACTNUM.DATA COPYONL
|
||||
configure_file(data/JFUNC.DATA data/JFUNC.DATA COPYONLY)
|
||||
|
||||
|
||||
foreach(prog completions deck group_tree parse_deck parse state props schedule wells)
|
||||
foreach(prog completions deck group_tree grupnet parse_deck parse state props schedule wells)
|
||||
|
||||
add_python_test(${prog} ${prog}.py)
|
||||
endforeach()
|
||||
|
||||
20
tests/grupnet.py
Normal file
20
tests/grupnet.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import unittest
|
||||
import sunbeam
|
||||
|
||||
|
||||
class TestGrupnet(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
norne = '../../examples/data/norne/NORNE_ATW2013.DATA'
|
||||
cls.sch = sunbeam.parse(norne, [('PARSE_RANDOM_SLASH', sunbeam.action.ignore)]).schedule
|
||||
|
||||
def test_vfp_table(self):
|
||||
self.assertEqual(0, self.sch.group(timestep=0)['PROD'].vfp_table_nr)
|
||||
self.assertEqual(9, self.sch.group(timestep=0)['MANI-E2'].vfp_table_nr)
|
||||
self.assertEqual(9, self.sch.group(timestep=247)['MANI-E2'].vfp_table_nr)
|
||||
self.assertEqual(9999, self.sch.group(timestep=0)['MANI-K1'].vfp_table_nr)
|
||||
self.assertEqual(0, self.sch.group(timestep=0)['INJE'].vfp_table_nr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user