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,20 +1,19 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
|
||||
|
||||
#include <pybind11/stl.h>
|
||||
#include "sunbeam.hpp"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
py::list wellnames( const Group& g, size_t timestep ) {
|
||||
return iterable_to_pylist( g.getWells( timestep ) );
|
||||
const std::set<std::string> wellnames( const Group& g, size_t timestep ) {
|
||||
return g.getWells( timestep );
|
||||
}
|
||||
}
|
||||
|
||||
void sunbeam::export_Group() {
|
||||
void sunbeam::export_Group(py::module& module) {
|
||||
|
||||
py::class_< Group >( "Group", py::no_init )
|
||||
.add_property( "name", mkcopy( &Group::name ) )
|
||||
.def( "_wellnames", &wellnames )
|
||||
;
|
||||
py::class_< Group >( module, "Group")
|
||||
.def_property_readonly( "name", &Group::name)
|
||||
.def( "_wellnames", &wellnames );
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user