From ee73226247b797acf57e9980d2551c730f8d0480 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Wed, 8 Nov 2023 19:03:22 -0500 Subject: [PATCH] test: use mfnwt in test_gwf_sto01.py, accommodate no dbl prec exes --- autotest/conftest.py | 24 +++++++++++++++--------- autotest/test_gwf_sto01.py | 6 ++++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/autotest/conftest.py b/autotest/conftest.py index 27ff70c453d..d95f542a233 100644 --- a/autotest/conftest.py +++ b/autotest/conftest.py @@ -53,12 +53,18 @@ def targets(bin_path) -> Executables: rb_bin = bin_path / "rebuilt" tgts = dict() + def try_dbl(name): + p = dl_bin / f"{name}dbl{exe_ext}" + if not p.is_file(): + p = dl_bin / f"{name}{exe_ext}" + return p + # downloaded executables tgts["mf2000"] = dl_bin / f"mf2000{exe_ext}" - tgts["mf2005"] = dl_bin / f"mf2005dbl{exe_ext}" - tgts["mfnwt"] = dl_bin / f"mfnwtdbl{exe_ext}" - tgts["mfusg"] = dl_bin / f"mfusgdbl{exe_ext}" - tgts["mflgr"] = dl_bin / f"mflgrdbl{exe_ext}" + tgts["mf2005"] = try_dbl("mf2005") + tgts["mfnwt"] = try_dbl("mfnwt") + tgts["mfusg"] = try_dbl("mfdbl") + tgts["mflgr"] = try_dbl("mflgr") tgts["mf2005s"] = dl_bin / f"mf2005{exe_ext}" tgts["mt3dms"] = dl_bin / f"mt3dms{exe_ext}" tgts["crt"] = dl_bin / f"crt{exe_ext}" @@ -93,7 +99,7 @@ def original_regression(request) -> bool: @pytest.fixture(scope="session") def markers(pytestconfig) -> str: - return pytestconfig.getoption('-m') + return pytestconfig.getoption("-m") def pytest_addoption(parser): @@ -104,10 +110,10 @@ def pytest_addoption(parser): help="TODO", ) parser.addoption( - "--parallel", - action="store_true", - default=False, - help="include parallel test cases" + "--parallel", + action="store_true", + default=False, + help="include parallel test cases", ) diff --git a/autotest/test_gwf_sto01.py b/autotest/test_gwf_sto01.py index c5328e0b3f5..e31999299d3 100644 --- a/autotest/test_gwf_sto01.py +++ b/autotest/test_gwf_sto01.py @@ -94,6 +94,7 @@ # storage and compaction data ske = [6e-4, 3e-4, 6e-4] + # variant SUB package problem 3 def build_model(idx, dir): name = ex[idx] @@ -201,7 +202,9 @@ def build_model(idx, dir): # build MODFLOW-NWT files cpth = cmppth ws = os.path.join(dir, cpth) - mc = flopy.modflow.Modflow(name, model_ws=ws, version=cpth) + mc = flopy.modflow.Modflow( + name, model_ws=ws, version=cpth, exe_name=cmppth + ) dis = flopy.modflow.ModflowDis( mc, nlay=nlay, @@ -256,7 +259,6 @@ def build_model(idx, dir): def eval_sto(sim): - print("evaluating storage...") # get results from listing file