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:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user