diff --git a/requirements.txt b/requirements.txt index d4a185048..a0a1fb645 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ pyyaml>=5.1 pyscal>=0.1.5 matplotlib numpy -ecl2df +ecl2df<0.5.0 configsuite six>=1.12.0 xtgeo diff --git a/src/subscript/convert_grid_format/convert_grid_format.py b/src/subscript/convert_grid_format/convert_grid_format.py index 6877b1135..26dd27f77 100644 --- a/src/subscript/convert_grid_format/convert_grid_format.py +++ b/src/subscript/convert_grid_format/convert_grid_format.py @@ -21,17 +21,15 @@ try: from ..version import version + __version__ = version except ImportError: __version__ = "0.0.0" -def _do_parse_args(args): - - if args is None: - args = sys.argv[1:] - else: - args = args +def get_parser(): + """Setup an argparse argument parser for parsing arguments + and making documentation""" usetxt = "convert_grid_format ... " @@ -86,6 +84,18 @@ def _do_parse_args(args): default=False, help="Use standard fmu name setting of file (no args)", ) + return parser + + +def _do_parse_args(args): + """Parse command line arguments""" + + if args is None: + args = sys.argv[1:] + else: + args = args + + parser = get_parser() if len(args) < 2: parser.print_help() @@ -170,6 +180,7 @@ def _convert_ecl2roff(filename, mode, outfile, option, props, dates): def main(args=None): + """Entry-point""" XTGeoDialog.print_xtgeo_header(APPNAME, __version__) diff --git a/tests/test_convert_grid_format.py b/tests/test_convert_grid_format.py index f3133608c..aeaafd1de 100644 --- a/tests/test_convert_grid_format.py +++ b/tests/test_convert_grid_format.py @@ -13,8 +13,12 @@ logger = xtg.basiclogger(__name__) -RFILE1 = "tests/data/reek/eclipse/model/2_R001_REEK-0.EGRID" -RFILE2 = "tests/data/reek/eclipse/model/2_R001_REEK-0.UNRST" +RFILE1 = os.path.join( + os.path.dirname(__file__), "data/reek/eclipse/model/2_R001_REEK-0.EGRID" +) +RFILE2 = os.path.join( + os.path.dirname(__file__), "data/reek/eclipse/model/2_R001_REEK-0.UNRST" +) def test_convert_grid_format_egrid(tmpdir):