Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions autotest/test_mp7.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def run_modpath7(namefile, mp7_exe, mf2005_exe, mfusg_exe, mf6_exe):
model_ws = (namefile).resolve().parent
# run the flow model
run = True
name = str(namefile).lower()
if "modflow-2005" in name:
name = model_ws.name.lower()
if name.endswith("_mf2005"):
v = shutil.which(mf2005_exe)
if v is None:
run = False
Expand All @@ -104,7 +104,7 @@ def run_modpath7(namefile, mp7_exe, mf2005_exe, mfusg_exe, mf6_exe):
else:
fpth = None
run = False
elif "modflow-usg" in name:
elif name.endswith("_mfusg"):
v = shutil.which(mfusg_exe)
if v is None:
run = False
Expand All @@ -114,7 +114,7 @@ def run_modpath7(namefile, mp7_exe, mf2005_exe, mfusg_exe, mf6_exe):
else:
fpth = None
run = False
elif "modflow-6" in name:
elif name.endswith("_mf6"):
v = shutil.which(mf6_exe)
if v is None:
run = False
Expand Down Expand Up @@ -176,16 +176,16 @@ def test_download_exes(module_tmpdir):
@pytest.mark.parametrize(
"namefile",
[
"ex01/modflow-2005/original/ex01a_mf2005.mpsim",
"ex01/modflow-2005/original/ex01b_mf2005.mpsim",
"ex01/modflow-6/original/ex01a_mf6.mpsim",
"ex01/modflow-6/original/ex01b_mf6.mpsim",
"ex02/modflow-6/original/ex02a_mf6.mpsim",
"ex02/modflow-6/original/ex02b_mf6.mpsim",
"ex02/modflow-usg/original/ex02a_mfusg.mpsim",
"ex02/modflow-usg/original/ex02b_mfusg.mpsim",
"ex03/modflow-6/original/ex03a_mf6.mpsim",
"ex04/modflow-6/original/ex04a_mf6.mpsim",
"ex01_mf2005/ex01a_mf2005.mpsim",
"ex01_mf2005/ex01b_mf2005.mpsim",
"ex01_mf6/ex01a_mf6.mpsim",
"ex01_mf6/ex01b_mf6.mpsim",
"ex02_mf6/ex02a_mf6.mpsim",
"ex02_mf6/ex02b_mf6.mpsim",
"ex02_mfusg/ex02a_mfusg.mpsim",
"ex02_mfusg/ex02b_mfusg.mpsim",
"ex03_mf6/ex03a_mf6.mpsim",
"ex04_mf6/ex04a_mf6.mpsim",
],
)
def test_modpath7(module_tmpdir, namefile, workspace, target):
Expand Down
21 changes: 21 additions & 0 deletions pymake/pymake.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
from .utils.download import download_and_unzip, zip_all
from .utils.usgsprograms import usgs_program_data

# targets whose distributed meson build files are removed after download, so
# that pymake writes its own. the mp6 build file lists source files by name,
# which the mp6 source update replaces with renamed copies
_IGNORE_PROVIDED_MESON = ("mp6",)


class Pymake:
"""Pymake class for interacting with pymake functionality. This is essentially
Expand Down Expand Up @@ -410,8 +415,24 @@ def download_url(self):
timeout=self.timeout,
verbose=self.verbose,
)
if self.download and self._get_base_target() in _IGNORE_PROVIDED_MESON:
self._remove_provided_meson()
return self.download

def _remove_provided_meson(self):
"""Remove the meson build files distributed with a downloaded target.

Returns
-------

"""
if self.download_dir is None:
return
for fpth in Path(self.download_dir).rglob("meson.build"):
if self.verbose:
print(f"removing the meson build file provided...'{fpth}'")
fpth.unlink()

def _download_cleanup(self):
"""Remove the temporary download directory.

Expand Down
8 changes: 4 additions & 4 deletions pymake/utils/usgsprograms.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ shared_object = true
[program."mp7"]
version = "7.2.001"
current = true
url = "https://water.usgs.gov/water-resources/software/MODPATH/modpath_7_2_001.zip"
dirname = "modpath_7_2_001"
url = "https://github.com/MODFLOW-ORG/modpath-v7/archive/refs/tags/7.2.001.zip"
dirname = "modpath-v7-7.2.001"
srcdir = "source"
standard_precision = true
double_precision = false
Expand Down Expand Up @@ -172,8 +172,8 @@ shared_object = false
[program."mp6"]
version = "6.0.1"
current = true
url = "https://water.usgs.gov/water-resources/software/MODPATH/modpath.6_0_01.zip"
dirname = "modpath.6_0"
url = "https://github.com/MODFLOW-ORG/modpath6/archive/d86c21a5091b5158c981178e8b95e33753c9f36a.zip"
dirname = "modpath6-d86c21a5091b5158c981178e8b95e33753c9f36a"
srcdir = "src"
standard_precision = true
double_precision = false
Expand Down
Loading