Use pybind11 as binding framework

This commit changes the api for the Schedule class, the various time related
methods now return datetime.datetime instances instead of datetime.data.
This commit is contained in:
Joakim Hove
2018-01-30 07:46:03 +01:00
parent 1566cd4e37
commit 67b30fe715
20 changed files with 268 additions and 346 deletions

View File

@@ -1,11 +1,7 @@
include( FindPythonModule )
include( PythonPackage )
#python_module( ctypes )
python_module( six )
#python_module( numpy REQUIRED 1.7 )
python_module( inspect OPTIONAL )
if (DEFINED PY_inspect)
message(STATUS "We have inspect.")
else()

View File

@@ -19,6 +19,9 @@ class Schedule(object):
def groups(self, timestep=0):
return [Group(x, self, timestep) for x in self._groups if x.name != 'FIELD']
def __getitem__(self,well):
return Well(self._getwell(well))
@delegate(lib.Well)
class Well(object):
@@ -34,6 +37,9 @@ class Well(object):
def completions(self, timestep):
return map(Completion, self._completions(timestep))
def __eq__(self,other):
return self._sun.__equal__(other._sun)
@staticmethod
def defined(timestep):
def fn(well): return well.isdefined(timestep)