Skip to content

Commit 74aa5ca

Browse files
mjrenomjreno
authored andcommitted
adjust twri workspace path
1 parent 27720e4 commit 74aa5ca

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

docs/examples/twri.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def plot_head(head, workspace):
173173
tdis = flopy4.mf6.simulation.Tdis.from_time(time)
174174

175175
# Create workspace
176-
workspace = Path(__file__).parent / "twri" / "list_stress"
176+
workspace = Path(__file__).parent / "twri" / "list_stresspkg"
177177
workspace.mkdir(parents=True, exist_ok=True)
178178

179179
# Create simulation
@@ -260,7 +260,7 @@ def plot_head(head, workspace):
260260
gwf.rcha = [rcha]
261261

262262
# create new workspace
263-
workspace = Path(__file__).parent / "twri" / "array_stress"
263+
workspace = Path(__file__).parent / "twri" / "array_stresspkg"
264264
workspace.mkdir(parents=True, exist_ok=True)
265265
sim.workspace = workspace
266266

test/test_examples.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def pytest_generate_tests(metafunc):
2020
metafunc.parametrize("example_script", scripts.values(), ids=scripts.keys())
2121

2222

23-
def compare_heads(compare_fpth, check_path):
23+
def compare_hds(compare_fpth, check_path):
2424
from flopy.utils import HeadFile
2525

2626
if compare_fpth.suffix == ".hds":
@@ -37,12 +37,12 @@ def compare_heads(compare_fpth, check_path):
3737
def compare_grb(compare_fpth, check_path):
3838
from flopy.mf6.utils import MfGrdFile
3939

40-
grb_compare = MfGrdFile(compare_fpth)._datadict
40+
grb_compare = MfGrdFile(compare_fpth)
4141

4242
# check *.grb files
4343
for f in check_path.rglob("*.grb"):
4444
grb = MfGrdFile(f)
45-
np.testing.assert_equal(grb_compare, grb._datadict)
45+
np.testing.assert_equal(grb_compare._datadict, grb._datadict)
4646

4747

4848
def compare_bud(compare_fpth, check_path):
@@ -72,16 +72,15 @@ def compare_bud(compare_fpth, check_path):
7272
def compare(example_script):
7373
from pathlib import Path
7474

75-
test_name = "test_examples"
7675
check_path = Path(f"{example_script.parent}/{example_script.stem}")
77-
compare_path = Path(f"{example_script.parent.parent.parent}/test/__compare__/{test_name}")
76+
compare_path = Path(f"{example_script.parent.parent.parent}/test/__compare__/test_examples")
7877

7978
for f in compare_path.glob(f"{example_script.stem}.*"):
8079
if f.suffix == ".bud" or f.suffix == ".cbc":
8180
compare_bud(f, check_path)
8281
if f.suffix == ".hds" or f.match("*hds.npy"):
83-
compare_heads(f, check_path)
84-
elif f.suffix == ".grb":
82+
compare_hds(f, check_path)
83+
if f.suffix == ".grb":
8584
compare_grb(f, check_path)
8685

8786

0 commit comments

Comments
 (0)