Skip to content

Commit

Permalink
Repair to pass travis, and sphinx-argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Feb 25, 2020
1 parent 03c2847 commit cc8d707
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pyyaml>=5.1
pyscal>=0.1.5
matplotlib
numpy
ecl2df
ecl2df<0.5.0
configsuite
six>=1.12.0
xtgeo
23 changes: 17 additions & 6 deletions src/subscript/convert_grid_format/convert_grid_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ... "

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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__)

Expand Down
8 changes: 6 additions & 2 deletions tests/test_convert_grid_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit cc8d707

Please sign in to comment.