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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions benchmarks/profile/_ff.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def build_flopy4(ws: Path, wel: str = "list") -> SimpleNamespace:
wels = [
gwf.Wel(
filename=f"{NAME}.{name}.wel",
period_data={p: list(cells.items()) for p, cells in data.items()},
stress_period_data={p: list(cells.items()) for p, cells in data.items()},
print_input=True,
print_flows=True,
save_flows=True,
Expand Down Expand Up @@ -272,7 +272,7 @@ def build_flopy4(ws: Path, wel: str = "list") -> SimpleNamespace:
oc=gwf.Oc(
budget_file=Path(f"{NAME}.cbc"),
head_file=Path(f"{NAME}.hds"),
period_data={
stress_period_data={
0: [
("SAVE", "HEAD", "ALL"),
("SAVE", "BUDGET", "STEPS", 1),
Expand Down
4 changes: 3 additions & 1 deletion benchmarks/profile/list_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def build_sim(n: int, ws: Path):
idomain=np.ones((nlay, nrow, n), dtype=int),
)
dims = {"nper": nper, **grid.dims}
rch = flopy4.mf6.gwf.Rch(period_data={0: [((0, 0, c), 0.001) for c in range(n)]}, dims=dims)
rch = flopy4.mf6.gwf.Rch(
stress_period_data={0: [((0, 0, c), 0.001) for c in range(n)]}, dims=dims
)
gwf = flopy4.mf6.gwf.Gwf(
name="diag",
dis=grid,
Expand Down
30 changes: 19 additions & 11 deletions benchmarks/profile/test_large_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ class Model1000(Model):
def __init__(self, gwf3):
super().__init__(gwf3.npf.k.array)
self.chd = {
tuple(int(x) for x in rec[0]): float(rec[1]) for rec in gwf3.chd.period_data.data[0]
tuple(int(x) for x in rec[0]): float(rec[1])
for rec in gwf3.chd.stress_period_data.data[0]
}
self.wel = {
tuple(int(x) for x in rec[0]): float(rec[1]) for rec in gwf3.wel.period_data.data[1]
tuple(int(x) for x in rec[0]): float(rec[1])
for rec in gwf3.wel.stress_period_data.data[1]
}
self.rch = {
"uniform": np.full((self.nper, self.ncpl), 0.001),
Expand Down Expand Up @@ -174,7 +176,7 @@ def base4(self, dims) -> dict:
oc=gwf.Oc(
budget_file=Path(f"{self.name}.cbc"),
head_file=Path(f"{self.name}.hds"),
period_data={0: [("SAVE", "HEAD", "LAST"), ("SAVE", "BUDGET", "LAST")]},
stress_period_data={0: [("SAVE", "HEAD", "LAST"), ("SAVE", "BUDGET", "LAST")]},
dims=dims,
),
)
Expand Down Expand Up @@ -248,10 +250,12 @@ def __init__(self, gwf3):
# drop WEL's auxiliary iface column
self.wel = {
period: {tuple(int(x) for x in rec[0]): float(rec[1]) for rec in records}
for period, records in gwf3.wel.period_data.data.items()
for period, records in gwf3.wel.stress_period_data.data.items()
}
# constant head 0, with the time series stripped
self.chd = {tuple(int(x) for x in rec[0]): 0.0 for rec in gwf3.chd.period_data.data[0]}
self.chd = {
tuple(int(x) for x in rec[0]): 0.0 for rec in gwf3.chd.stress_period_data.data[0]
}

def grid(self):
import flopy4
Expand Down Expand Up @@ -295,7 +299,7 @@ def base4(self, dims) -> dict:
oc=gwf.Oc(
budget_file=Path(f"{self.name}.cbc"),
head_file=Path(f"{self.name}.hds"),
period_data={0: [("SAVE", "HEAD", "LAST"), ("SAVE", "BUDGET", "LAST")]},
stress_period_data={0: [("SAVE", "HEAD", "LAST"), ("SAVE", "BUDGET", "LAST")]},
dims=dims,
),
rch=[gwf.Rcha(recharge=self.rcha, dims=dims)],
Expand Down Expand Up @@ -393,8 +397,10 @@ def test_test1000_sparse(benchmark, quiet, tmp_path, test1000, variant):

def lists(dims):
return dict(
chd=gwf.Chd(period_data=spd({0: t.chd}), print_flows=True, save_flows=True, dims=dims),
wel=gwf.Wel(period_data=spd({1: t.wel}), save_flows=True, dims=dims),
chd=gwf.Chd(
stress_period_data=spd({0: t.chd}), print_flows=True, save_flows=True, dims=dims
),
wel=gwf.Wel(stress_period_data=spd({1: t.wel}), save_flows=True, dims=dims),
)

def grids(dims):
Expand Down Expand Up @@ -445,7 +451,7 @@ def test_test1000_rch(benchmark, quiet, tmp_path, test1000, data, variant):
rch_list = spd(t.rch_list(data))

def packages(dims):
return dict(rch=[gwf.Rch(period_data=rch_list, dims=dims)])
return dict(rch=[gwf.Rch(stress_period_data=rch_list, dims=dims)])
else:

def packages(dims):
Expand All @@ -466,8 +472,10 @@ def test_test1005(benchmark, quiet, tmp_path, test1005, variant):

def lists(dims):
return dict(
chd=gwf.Chd(period_data=spd({0: t.chd}), print_flows=True, save_flows=True, dims=dims),
wel=gwf.Wel(period_data=spd(t.wel), save_flows=True, dims=dims),
chd=gwf.Chd(
stress_period_data=spd({0: t.chd}), print_flows=True, save_flows=True, dims=dims
),
wel=gwf.Wel(stress_period_data=spd(t.wel), save_flows=True, dims=dims),
)

def grids(dims):
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/circle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
"sto = flopy4.mf6.gwf.Sto(\n",
" ss=1.0e-5,\n",
" sy=0.15,\n",
" period_data={0: [(\"STEADY-STATE\",)]},\n",
" stress_period_data={0: [(\"STEADY-STATE\",)]},\n",
" iconvert=0,\n",
" dims=dims,\n",
")"
Expand Down Expand Up @@ -610,7 +610,7 @@
"for i in np.where(chd_location)[0]:\n",
" chd_head[(1, int(i))] = 1.0\n",
"chd = flopy4.mf6.gwf.Chd(\n",
" period_data={0: [(cellid, head_val) for cellid, head_val in chd_head.items()]},\n",
" stress_period_data={0: [(cellid, head_val) for cellid, head_val in chd_head.items()]},\n",
" print_input=True,\n",
" print_flows=True,\n",
" save_flows=True,\n",
Expand All @@ -633,7 +633,7 @@
"outputs": [],
"source": [
"# Recharge: uniform rate applied to every cell in the top layer.\n",
"rch = flopy4.mf6.gwf.Rch(period_data={0: [((0, j), 0.001) for j in range(ncpl)]}, dims=dims)"
"rch = flopy4.mf6.gwf.Rch(stress_period_data={0: [((0, j), 0.001) for j in range(ncpl)]}, dims=dims)"
]
},
{
Expand All @@ -654,7 +654,7 @@
"oc = flopy4.mf6.gwf.Oc(\n",
" budget_file=\"gwf.bud\",\n",
" head_file=\"gwf.hds\",\n",
" period_data={0: [(\"SAVE\", \"HEAD\", \"ALL\"), (\"SAVE\", \"BUDGET\", \"ALL\")]},\n",
" stress_period_data={0: [(\"SAVE\", \"HEAD\", \"ALL\"), (\"SAVE\", \"BUDGET\", \"ALL\")]},\n",
" dims=dims,\n",
")"
]
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def plot_head_ugrid(head, cbc, workspace):
sto = flopy4.mf6.gwf.Sto(
ss=1.0e-5,
sy=0.15,
period_data={0: [("STEADY-STATE",)]},
stress_period_data={0: [("STEADY-STATE",)]},
iconvert=0,
dims=dims,
)
Expand All @@ -186,21 +186,21 @@ def plot_head_ugrid(head, cbc, workspace):
for i in np.where(chd_location)[0]:
chd_head[(1, int(i))] = 1.0
chd = flopy4.mf6.gwf.Chd(
period_data={0: [(cellid, head_val) for cellid, head_val in chd_head.items()]},
stress_period_data={0: [(cellid, head_val) for cellid, head_val in chd_head.items()]},
print_input=True,
print_flows=True,
save_flows=True,
dims=dims,
)

# Recharge: uniform rate applied to every cell in the top layer.
rch = flopy4.mf6.gwf.Rch(period_data={0: [((0, j), 0.001) for j in range(ncpl)]}, dims=dims)
rch = flopy4.mf6.gwf.Rch(stress_period_data={0: [((0, j), 0.001) for j in range(ncpl)]}, dims=dims)

# Output control: write heads and budget to binary files.
oc = flopy4.mf6.gwf.Oc(
budget_file="gwf.bud",
head_file="gwf.hds",
period_data={0: [("SAVE", "HEAD", "ALL"), ("SAVE", "BUDGET", "ALL")]},
stress_period_data={0: [("SAVE", "HEAD", "ALL"), ("SAVE", "BUDGET", "ALL")]},
dims=dims,
)

Expand Down
8 changes: 4 additions & 4 deletions docs/examples/frenchman-flat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@
"# Constant-rate pumping well: alternates between extraction and shut-in.\n",
"wel_crt = flopy4.mf6.gwf.Wel(\n",
" filename=\"ff.crt.wel\",\n",
" period_data={\n",
" stress_period_data={\n",
" 0: [((1, 43, 43), -30992.50)],\n",
" 1: [((1, 43, 43), -00000.0)],\n",
" 2: [((1, 43, 43), -30992.50)],\n",
Expand Down Expand Up @@ -847,7 +847,7 @@
"# Leakage well: injects contaminated water at rates that vary by period.\n",
"wel_leak = flopy4.mf6.gwf.Wel(\n",
" filename=\"ff.leak.wel\",\n",
" period_data={\n",
" stress_period_data={\n",
" 0: [((1, 43, 43), 1.0000000e-05)],\n",
" 7: [((1, 43, 43), 1.5000000e03)],\n",
" 8: [((1, 43, 43), 2.6500000e03)],\n",
Expand Down Expand Up @@ -888,7 +888,7 @@
"# Sampling well: extracts water for monitoring at scheduled intervals.\n",
"wel_sampleQ = flopy4.mf6.gwf.Wel(\n",
" filename=\"ff.sampleQ.wel\",\n",
" period_data={\n",
" stress_period_data={\n",
" 0: [((1, 43, 43), -00000.0)],\n",
" 22: [((1, 43, 43), -04981.90)],\n",
" 23: [((1, 43, 43), -00000.0)],\n",
Expand Down Expand Up @@ -926,7 +926,7 @@
"oc = flopy4.mf6.gwf.Oc(\n",
" budget_file=Path(\"ff.cbc\"),\n",
" head_file=Path(\"ff.hds\"),\n",
" period_data={\n",
" stress_period_data={\n",
" 0: [\n",
" (\"SAVE\", \"HEAD\", \"ALL\"),\n",
" (\"SAVE\", \"BUDGET\", \"STEPS\", 1),\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/frenchman-flat.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def plot_head_ugrid(head, cbc, grid, workspace):
# Constant-rate pumping well: alternates between extraction and shut-in.
wel_crt = flopy4.mf6.gwf.Wel(
filename="ff.crt.wel",
period_data={
stress_period_data={
0: [((1, 43, 43), -30992.50)],
1: [((1, 43, 43), -00000.0)],
2: [((1, 43, 43), -30992.50)],
Expand All @@ -550,7 +550,7 @@ def plot_head_ugrid(head, cbc, grid, workspace):
# Leakage well: injects contaminated water at rates that vary by period.
wel_leak = flopy4.mf6.gwf.Wel(
filename="ff.leak.wel",
period_data={
stress_period_data={
0: [((1, 43, 43), 1.0000000e-05)],
7: [((1, 43, 43), 1.5000000e03)],
8: [((1, 43, 43), 2.6500000e03)],
Expand All @@ -576,7 +576,7 @@ def plot_head_ugrid(head, cbc, grid, workspace):
# Sampling well: extracts water for monitoring at scheduled intervals.
wel_sampleQ = flopy4.mf6.gwf.Wel(
filename="ff.sampleQ.wel",
period_data={
stress_period_data={
0: [((1, 43, 43), -00000.0)],
22: [((1, 43, 43), -04981.90)],
23: [((1, 43, 43), -00000.0)],
Expand All @@ -599,7 +599,7 @@ def plot_head_ugrid(head, cbc, grid, workspace):
oc = flopy4.mf6.gwf.Oc(
budget_file=Path("ff.cbc"),
head_file=Path("ff.hds"),
period_data={
stress_period_data={
0: [
("SAVE", "HEAD", "ALL"),
("SAVE", "BUDGET", "STEPS", 1),
Expand Down
Loading
Loading