python: removed group_tree.
This commit is contained in:
parent
0bc150794d
commit
dd4cce4e9a
@ -245,7 +245,6 @@ if (OPM_ENABLE_PYTHON)
|
||||
python/cxx/eclipse_grid.cpp
|
||||
python/cxx/eclipse_state.cpp
|
||||
python/cxx/group.cpp
|
||||
python/cxx/group_tree.cpp
|
||||
python/cxx/parsecontext.cpp
|
||||
python/cxx/parser.cpp
|
||||
python/cxx/schedule.cpp
|
||||
|
@ -10,7 +10,6 @@ void python::common::export_all(py::module& module) {
|
||||
export_Schedule(module);
|
||||
export_Well(module);
|
||||
export_Group(module);
|
||||
export_GroupTree(module);
|
||||
export_Connection(module);
|
||||
export_EclipseConfig(module);
|
||||
export_Eclipse3DProperties(module);
|
||||
|
@ -22,7 +22,6 @@ void export_EclipseConfig(py::module& module);
|
||||
void export_EclipseGrid(py::module& module);
|
||||
void export_EclipseState(py::module& module);
|
||||
void export_Group(py::module& module);
|
||||
void export_GroupTree(py::module& module);
|
||||
void export_ParseContext(py::module& module);
|
||||
void export_Parser(py::module& module);
|
||||
void export_Schedule(py::module& module);
|
||||
|
@ -1,27 +0,0 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
|
||||
#include "export.hpp"
|
||||
#include "converters.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
GTNode parent( const GTNode & gt ) {
|
||||
return gt.parent();
|
||||
}
|
||||
|
||||
py::list children( const GTNode & gt ) {
|
||||
return iterable_to_pylist(gt.groups()) ;
|
||||
}
|
||||
}
|
||||
|
||||
void python::common::export_GroupTree(py::module& module) {
|
||||
|
||||
py::class_<GTNode>(module, "GroupTree")
|
||||
|
||||
.def( "name", >Node::name)
|
||||
.def( "_parent", &parent, "parent function returning parent of a group")
|
||||
.def( "_children", &children, "children function returning python"
|
||||
" list containing children of a group")
|
||||
;
|
||||
}
|
@ -59,7 +59,6 @@ ext_modules = [
|
||||
'cxx/eclipse_grid.cpp',
|
||||
'cxx/eclipse_state.cpp',
|
||||
'cxx/group.cpp',
|
||||
'cxx/group_tree.cpp',
|
||||
'cxx/parsecontext.cpp',
|
||||
'cxx/parser.cpp',
|
||||
'cxx/schedule.cpp',
|
||||
|
@ -1,45 +0,0 @@
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import opm.io
|
||||
|
||||
class TestGroupTree(unittest.TestCase):
|
||||
|
||||
"""
|
||||
def setUp(self):
|
||||
norne = 'examples/data/norne/NORNE_ATW2013.DATA'
|
||||
self.sch = opm.io.parse(norne, [('PARSE_RANDOM_SLASH', opm.io.action.ignore)]).schedule
|
||||
|
||||
def test_group(self):
|
||||
gr = self.sch.group(timestep=2)['PROD']
|
||||
|
||||
self.assertEqual('PROD', gr.name)
|
||||
self.assertEqual('MANI-B2', gr.children[0].name)
|
||||
self.assertEqual(6, len(gr.children))
|
||||
|
||||
# The group <-> Schedule implementation is quite complicated with lots
|
||||
# of self references going back from the group object to the Schedule
|
||||
# object; these tests have just been commented out when implementing
|
||||
# the GTNode based tree implementation.
|
||||
|
||||
# self.assertEqual('FIELD', gr.parent.name)
|
||||
# self.assertEqual(2, gr.timestep)
|
||||
# self.assertEqual(None, gr.parent.parent)
|
||||
|
||||
def test_timestep_groups(self):
|
||||
total = 0
|
||||
for group in self.sch.groups(timestep=3):
|
||||
for child in group.children:
|
||||
self.assertIsNotNone(child.name)
|
||||
total += 1
|
||||
self.assertEqual(13, total)
|
||||
|
||||
group = self.sch.group(timestep=3)['PROD']
|
||||
children = ['MANI-B1', 'MANI-B2', 'MANI-D1', 'MANI-D2', 'MANI-E1', 'MANI-E2']
|
||||
names = [child.name for child in group.children]
|
||||
self.assertEqual(opm.io.schedule.Group, type(child))
|
||||
self.assertEqual(set(children), set(names))
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in New Issue
Block a user