Add python wrapper for Schedule::wellNames( const std::string& )

This commit is contained in:
Joakim Hove 2020-07-01 11:01:12 +02:00
parent 29a946eb9a
commit ab821b90a5
2 changed files with 11 additions and 0 deletions

View File

@ -103,6 +103,7 @@ void python::common::export_Schedule(py::module& module) {
.def( "open_well", &Schedule::open_well)
.def( "stop_well", &Schedule::stop_well)
.def( "get_wells", &Schedule::getWells)
.def("well_names", py::overload_cast<const std::string&>(&Schedule::wellNames, py::const_))
.def( "get_well", &get_well)
.def( "__contains__", &has_well )
.def( "group", &Schedule::getGroup, ref_internal);

View File

@ -75,5 +75,15 @@ class TestSchedule(unittest.TestCase):
rst = sch.restart
def test_well_names(self):
deck = Parser().parse(test_path('spe3/SPE3CASE1.DATA'))
state = EclipseState(deck)
sch = Schedule( deck, state )
wnames = sch.well_names("*")
self.assertTrue("PROD" in wnames)
self.assertTrue("INJ" in wnames)
self.assertEqual(len(wnames), 2)
if __name__ == "__main__":
unittest.main()