Files
opm-common/python/sunbeam/group_tree.cpp
Joakim Hove 77795b5005 Add 'python/' from commit '278373703455ea6562a0f8e5278b4db46eb1fc7e'
git-subtree-dir: python
git-subtree-mainline: e8dbf7d8ee
git-subtree-split: 2783737034
2019-05-08 07:20:29 +02:00

27 lines
848 B
C++

#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include "sunbeam.hpp"
#include "converters.hpp"
namespace {
std::string parent( const GroupTree& gt, const std::string& name ) {
return gt.parent(name);
}
py::list children( const GroupTree& gt, const std::string& name ) {
return iterable_to_pylist(gt.children(name)) ;
}
}
void sunbeam::export_GroupTree(py::module& module) {
py::class_< GroupTree >(module, "GroupTree")
.def( "_parent", &parent, "parent function returning parent of a group")
.def( "_children", &children, "children function returning python"
" list containing children of a group")
;
}