Skip to content

Commit 8ea0a7c

Browse files
committed
cleanup
1 parent 29c0708 commit 8ea0a7c

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

autotest/test_prt_clamp.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
vertical dimensions. There is currently no distance limit; particles may
44
begin arbitrarily far outside the cell.
55
6-
For rectilinear cells using Pollock's method, a particle will be snapped
7-
to the point within the cell nearest to its original point outside it: a
8-
"box clamp", in other words.
6+
For rectilinear cells using Pollock's method, a particle will be clamped
7+
to the point within the cell nearest to the point outside: a "box clamp".
98
109
For cells using the generalized (ternary) tracking method, a particle is
1110
not guaranteed to end up at the nearest point within the cell.
@@ -29,8 +28,8 @@
2928
METHODS = {"p": "pollock", "n": "ternary"}
3029
DIRECTIONS = {"": "x", "z": "z"}
3130

32-
cases_nudge = [
33-
(f"nudge{dircode}{mcode}{dcode}", method, offset, direction)
31+
cases = [
32+
(f"{dircode}{mcode}{dcode}", method, offset, direction)
3433
for dircode, direction in DIRECTIONS.items()
3534
for mcode, method in METHODS.items()
3635
for dcode, offset in DISTANCES.items()
@@ -75,7 +74,7 @@ def build_gwf_sim_disv(name, ws, mf6):
7574
return sim
7675

7776

78-
def build_prt_sim_nudge(name, gwf_ws, prt_ws, mf6, method, offset, direction):
77+
def build_prt_sim(name, gwf_ws, prt_ws, mf6, method, offset, direction):
7978
gridprops = get_gridprops_rect()
8079

8180
sim = flopy.mf6.MFSimulation(
@@ -141,9 +140,9 @@ def build_prt_sim_nudge(name, gwf_ws, prt_ws, mf6, method, offset, direction):
141140
return sim
142141

143142

144-
def build_models_nudge(test, method, offset, direction):
143+
def build_models(test, method, offset, direction):
145144
gwf_sim = build_gwf_sim_disv(test.name, test.workspace, test.targets["mf6"])
146-
prt_sim = build_prt_sim_nudge(
145+
prt_sim = build_prt_sim(
147146
test.name,
148147
test.workspace,
149148
test.workspace / "prt",
@@ -155,7 +154,7 @@ def build_models_nudge(test, method, offset, direction):
155154
return gwf_sim, prt_sim
156155

157156

158-
def check_output_nudge(test, offset, direction):
157+
def check_output(test, offset, direction):
159158
prt_name = get_model_name(test.name, "prt")
160159
prt_ws = test.workspace / "prt"
161160
mf6_pls = pd.read_csv(prt_ws / f"{prt_name}.trk.csv", na_filter=False)
@@ -172,7 +171,7 @@ def check_output_nudge(test, offset, direction):
172171
assert release["y"] == pytest.approx(9.5)
173172
assert release["z"] == pytest.approx(FlopyReadmeCase.botm[0] - offset)
174173

175-
# subsequent events should report the "snapped" coordinates
174+
# subsequent events should report the clamped coordinates
176175
ncol = FlopyReadmeCase.ncol
177176
nrow = FlopyReadmeCase.nrow
178177
top = FlopyReadmeCase.top
@@ -185,13 +184,13 @@ def check_output_nudge(test, offset, direction):
185184
assert (mf6_pls["t"].diff().dropna() >= -1e-9).all()
186185

187186

188-
@pytest.mark.parametrize("name, method, offset, direction", cases_nudge)
189-
def test_mf6model_nudge(name, method, offset, direction, function_tmpdir, targets):
187+
@pytest.mark.parametrize("name, method, offset, direction", cases)
188+
def test_mf6model(name, method, offset, direction, function_tmpdir, targets):
190189
test = TestFramework(
191190
name=name,
192191
workspace=function_tmpdir,
193-
build=lambda t: build_models_nudge(t, method, offset, direction),
194-
check=lambda t: check_output_nudge(t, offset, direction),
192+
build=lambda t: build_models(t, method, offset, direction),
193+
check=lambda t: check_output(t, offset, direction),
195194
targets=targets,
196195
compare=None,
197196
)

0 commit comments

Comments
 (0)