Skip to content

Commit 20bfbc1

Browse files
authored
update xattree to fix quickstart, minor cleanup (#128)
this was what was preventing CHD packages from binding correctly modflowpy/xattree#21
1 parent fc09610 commit 20bfbc1

File tree

3 files changed

+185
-187
lines changed

3 files changed

+185
-187
lines changed

docs/examples/quickstart.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from flopy4.mf6.simulation import Simulation
99
from flopy4.mf6.tdis import Tdis
1010

11-
ws = Path("./quickstart_data")
11+
ws = Path(__file__).parent / "quickstart_data"
1212
name = "mymodel"
1313
tdis = Tdis()
1414
ims = Ims()
@@ -41,24 +41,21 @@
4141
assert oc.data["save_head"][0] == "all"
4242
assert oc.data.save_head.sel(per=0) == "all"
4343

44-
# PLOT
45-
46-
# set specific discharge
47-
spdis = gwf.output.budget
48-
heads = gwf.output.head
49-
sq = heads.squeeze()
44+
# get head and budget results
45+
budget = gwf.output.budget.squeeze()
46+
head = gwf.output.head.squeeze()
5047

48+
# make plot
5149
fig, ax = plt.subplots()
5250
ax.tick_params()
5351
ax.set_xticks(np.arange(0, 11, 2), minor=False)
5452
ax.set_xticks(np.arange(1, 10, 2), minor=True)
5553
ax.set_yticks(np.arange(0, 11, 2), minor=False)
5654
ax.set_yticks(np.arange(1, 10, 2), minor=True)
5755
ax.grid(which="both", color="white")
58-
sq.plot.imshow(ax=ax)
59-
sq.plot.contour(ax=ax, levels=[0.2, 0.4, 0.6, 0.8], linewidths=3.0)
60-
spdis.squeeze().plot.quiver(
56+
head.plot.imshow(ax=ax)
57+
head.plot.contour(ax=ax, levels=[0.2, 0.4, 0.6, 0.8], linewidths=3.0)
58+
budget.plot.quiver(
6159
x="x", y="y", u="npf-qx", v="npf-qy", ax=ax, color="white"
6260
)
63-
qs_pth = Path("./image/quickstart.png")
64-
fig.savefig(qs_pth)
61+
fig.savefig(ws / "quickstart.png")

0 commit comments

Comments
 (0)