diff --git a/python/python/opm/io/__init__.py b/python/python/opm/io/__init__.py index c20ce626c..bd753cc34 100644 --- a/python/python/opm/io/__init__.py +++ b/python/python/opm/io/__init__.py @@ -1,3 +1 @@ -from opm._common import action - -from .parser import parse, load_deck, load_deck_string, parse_string +from .parser import * diff --git a/python/python/opm/io/config/__init__.py b/python/python/opm/io/config/__init__.py new file mode 100644 index 000000000..27c9ec622 --- /dev/null +++ b/python/python/opm/io/config/__init__.py @@ -0,0 +1 @@ +from .config import * diff --git a/python/python/opm/io/config.py b/python/python/opm/io/config/config.py similarity index 88% rename from python/python/opm/io/config.py rename to python/python/opm/io/config/config.py index 4f6544143..39a126813 100644 --- a/python/python/opm/io/config.py +++ b/python/python/opm/io/config/config.py @@ -1,13 +1,15 @@ from __future__ import absolute_import from opm import libopmcommon_python as lib -from .sunbeam import delegate +from ..parser.sunbeam import delegate + @delegate(lib.SummaryConfig) class SummaryConfig(object): def __repr__(self): return 'SummaryConfig()' + @delegate(lib.EclipseConfig) class EclipseConfig(object): def __repr__(self): diff --git a/python/python/opm/io/parser/__init__.py b/python/python/opm/io/parser/__init__.py new file mode 100644 index 000000000..e16a1c6f4 --- /dev/null +++ b/python/python/opm/io/parser/__init__.py @@ -0,0 +1,4 @@ +from opm._common import action + +from .parser import parse, load_deck, load_deck_string, parse_string + diff --git a/python/python/opm/io/parser.py b/python/python/opm/io/parser/parser.py similarity index 100% rename from python/python/opm/io/parser.py rename to python/python/opm/io/parser/parser.py diff --git a/python/python/opm/io/properties.py b/python/python/opm/io/parser/properties.py similarity index 97% rename from python/python/opm/io/properties.py rename to python/python/opm/io/parser/properties.py index beba04eff..bb635c6c3 100644 --- a/python/python/opm/io/properties.py +++ b/python/python/opm/io/parser/properties.py @@ -3,8 +3,8 @@ from os.path import isfile from opm import libopmcommon_python as lib from .sunbeam import delegate -from .schedule import Schedule -from .config import EclipseConfig +from ..schedule import Schedule +from ..config import EclipseConfig @delegate(lib.EclipseState) class EclipseState(object): diff --git a/python/python/opm/io/sunbeam.py b/python/python/opm/io/parser/sunbeam.py similarity index 100% rename from python/python/opm/io/sunbeam.py rename to python/python/opm/io/parser/sunbeam.py diff --git a/python/python/opm/io/schedule/__init__.py b/python/python/opm/io/schedule/__init__.py new file mode 100644 index 000000000..b7ee57067 --- /dev/null +++ b/python/python/opm/io/schedule/__init__.py @@ -0,0 +1 @@ +from .schedule import * diff --git a/python/python/opm/io/schedule.py b/python/python/opm/io/schedule/schedule.py similarity index 99% rename from python/python/opm/io/schedule.py rename to python/python/opm/io/schedule/schedule.py index 3e247d615..311849544 100644 --- a/python/python/opm/io/schedule.py +++ b/python/python/opm/io/schedule/schedule.py @@ -1,7 +1,7 @@ from __future__ import absolute_import from opm import libopmcommon_python as lib -from .sunbeam import delegate +from ..parser.sunbeam import delegate @delegate(lib.Schedule) class Schedule(object): diff --git a/python/python/opm/tools/time_vector.py b/python/python/opm/tools/time_vector.py index 800258192..2413d6b5b 100644 --- a/python/python/opm/tools/time_vector.py +++ b/python/python/opm/tools/time_vector.py @@ -6,7 +6,7 @@ except ImportError: from io import StringIO -from opm.parser import load_deck, load_deck_string +from opm.io.parser import load_deck, load_deck_string # This is from the TimeMap.cpp implementation in opm ecl_month = {"JAN" : 1, diff --git a/python/setup.py b/python/setup.py index c9b9c6ac4..74071846b 100644 --- a/python/setup.py +++ b/python/setup.py @@ -76,6 +76,9 @@ setup( packages=[ 'opm', 'opm.io', + 'opm.io.parser', + 'opm.io.schedule', + 'opm.io.config', 'opm.tools' ], ext_modules=ext_modules,