Skip to content

Commit ebfef0e

Browse files
authored
Merge pull request #2619 from modflowpy/v3.9.4
Release 3.9.4
2 parents af463ac + fe275bc commit ebfef0e

File tree

720 files changed

+277270
-61197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

720 files changed

+277270
-61197
lines changed

.docs/Notebooks/dis_voronoi_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
import flopy
3737
from flopy.discretization import VertexGrid
38-
from flopy.utils.triangle import Triangle as Triangle
38+
from flopy.utils.triangle import Triangle
3939
from flopy.utils.voronoi import VoronoiGrid
4040

4141
temp_dir = TemporaryDirectory()

.docs/Notebooks/export_vtk_tutorial.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,16 @@
211211
# Create a vtk object
212212
vtkobj = vtk.Vtk(ml, vertical_exageration=10)
213213

214-
## create some random array data
214+
# create some random array data
215215
r_array = np.random.random(ml.modelgrid.nnodes) * 100
216216

217-
## add random data to the VTK object
217+
# add random data to the VTK object
218218
vtkobj.add_array(r_array, "random_data")
219219

220-
## add the model botom data to the VTK object
220+
# add the model botom data to the VTK object
221221
vtkobj.add_array(ml.dis.botm.array, "botm")
222222

223-
## write the vtk object to file
223+
# write the vtk object to file
224224
vtkobj.write(output_dir / "Array_example" / "model.vtu")
225225
# -
226226

@@ -237,12 +237,12 @@
237237
# create a vtk object
238238
vtkobj = vtk.Vtk(ml, xml=True, pvd=True, vertical_exageration=10)
239239

240-
## add recharge to the VTK object
240+
# add recharge to the VTK object
241241
subset = list(range(10))
242242
recharge = {k: v for k, v in ml.rch.rech.transient_2ds.items() if k in subset}
243243
vtkobj.add_transient_array(recharge, "recharge", masked_values=[0])
244244

245-
## write vtk files
245+
# write vtk files
246246
vtkobj.write(output_dir / "tr_array_example" / "recharge.vtu")
247247
# -
248248

@@ -258,11 +258,11 @@
258258
# create the vtk object
259259
vtkobj = vtk.Vtk(ml, xml=True, pvd=True, vertical_exageration=10)
260260

261-
## add well fluxes to the VTK object
261+
# add well fluxes to the VTK object
262262
spd = ml.wel.stress_period_data
263263
vtkobj.add_transient_list(spd, masked_values=[0])
264264

265-
## write vtk files (skipped, slow)
265+
# write vtk files (skipped, slow)
266266
# vtkobj.write(output_dir / "tr_list_example" / "wel_flux.vtu")
267267
# -
268268

.docs/Notebooks/gridgen_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@
426426
structured=False,
427427
)
428428
disu = flopy.mfusg.MfUsgDisU(m, **gridprops)
429-
bas = flopy.modflow.ModflowBas(m)
429+
bas = flopy.mfusg.MfUsgBas(m)
430430
lpf = flopy.mfusg.MfUsgLpf(m)
431431
chd = flopy.modflow.ModflowChd(m, stress_period_data=chdspd)
432432
sms = flopy.mfusg.MfUsgSms(m)

.docs/Notebooks/groundwater2023_watershed_example.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@
2222
#
2323

2424
import os
25-
import pathlib as pl
2625
import sys
26+
from pathlib import Path
2727

2828
import git
2929
import matplotlib as mpl
30-
import matplotlib.gridspec as gridspec
3130
import matplotlib.pyplot as plt
3231
import numpy as np
3332
import pooch
3433
import shapely
3534
import yaml
35+
from matplotlib import gridspec
3636
from shapely.geometry import LineString, Polygon
3737

3838
import flopy
39-
import flopy.plot.styles as styles
4039
from flopy.discretization import StructuredGrid, VertexGrid
40+
from flopy.plot import styles
4141
from flopy.utils.gridgen import Gridgen
4242
from flopy.utils.gridintersect import GridIntersect
4343
from flopy.utils.triangle import Triangle
@@ -101,7 +101,7 @@ def set_idomain(grid, boundary):
101101
nr = idx.shape[0]
102102
if idx.ndim == 1:
103103
idx = idx.reshape((nr, 1))
104-
idx = tuple([idx[:, i] for i in range(idx.shape[1])])
104+
idx = tuple(idx[:, i] for i in range(idx.shape[1]))
105105
idomain = np.zeros(grid.shape[1:], dtype=int)
106106
idomain[idx] = 1
107107
idomain = idomain.reshape(grid.shape)
@@ -111,11 +111,11 @@ def set_idomain(grid, boundary):
111111
# Check if we are in the repository and define the data path.
112112

113113
try:
114-
root = pl.Path(git.Repo(".", search_parent_directories=True).working_dir)
114+
root = Path(git.Repo(".", search_parent_directories=True).working_dir)
115115
except:
116116
root = None
117117

118-
data_path = root / "examples" / "data" if root else pl.Path.cwd()
118+
data_path = root / "examples" / "data" if root else Path.cwd()
119119
folder_name = "groundwater2023"
120120
fname = "geometries.yml"
121121
pooch.retrieve(
@@ -482,7 +482,7 @@ def set_idomain(grid, boundary):
482482

483483
# +
484484
sim = flopy.mf6.MFSimulation()
485-
gwf = gwf = flopy.mf6.ModflowGwf(sim)
485+
gwf = flopy.mf6.ModflowGwf(sim)
486486
dx = dy = 5000.0
487487
nr = int(Ly / dy)
488488
nc = int(Lx / dx)
@@ -737,15 +737,15 @@ def set_idomain(grid, boundary):
737737

738738
ax.set_xlim(extent[0], extent[1])
739739
ax.set_xticks(np.arange(0, 200000, 50000))
740-
if idx in (4, 5):
740+
if idx in {4, 5}:
741741
ax.set_xticklabels(np.arange(0, 200, 50))
742742
ax.set_xlabel("x position (km)")
743743
else:
744744
ax.set_xticklabels([])
745745

746746
ax.set_ylim(extent[2], extent[3])
747747
ax.set_yticks(np.arange(0, 150000, 50000))
748-
if idx in (0, 2, 4):
748+
if idx in {0, 2, 4}:
749749
ax.set_yticklabels(np.arange(0, 150, 50))
750750
ax.set_ylabel("y position (km)")
751751
else:
@@ -886,15 +886,15 @@ def set_idomain(grid, boundary):
886886

887887
ax.set_xlim(extent[0], extent[1])
888888
ax.set_xticks(np.arange(50000, 120000, 10000))
889-
if idx in (4, 5):
889+
if idx in {4, 5}:
890890
ax.set_xticklabels(np.arange(50, 120, 10))
891891
ax.set_xlabel("x position (km)")
892892
else:
893893
ax.set_xticklabels([])
894894

895895
ax.set_ylim(extent[2], extent[3])
896896
ax.set_yticks(np.arange(35000, 70000, 10000))
897-
if idx in (0, 2, 4):
897+
if idx in {0, 2, 4}:
898898
ax.set_yticklabels(np.arange(35, 75, 10))
899899
ax.set_ylabel("y position (km)")
900900
else:

.docs/Notebooks/mf6_support_example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# - `sim_ws`: `os.curdir` ('.')
4747
# - `sim_tdis_file`: 'modflow6.tdis'
4848
#
49-
# The `sim_ws` parameter accepts `str` or `os.PathLike` arguments.
49+
# The `sim_ws` parameter accepts `str` or `PathLike` arguments.
5050

5151
# +
5252
import os
@@ -495,7 +495,7 @@
495495
model.dis.export(pth / "dis.nc")
496496

497497
# export the botm array to a shapefile
498-
model.dis.botm.export(str(pth / "botm.shp")) # supports os.PathLike or str
498+
model.dis.botm.export(pth / "botm.shp") # supports PathLike or str
499499
# -
500500

501501
# ## Loading an Existing MF6 Simulation
@@ -521,7 +521,7 @@
521521

522522
# +
523523
# get hydraulic conductivity data object from the data dictionary
524-
hk = sim.simulation_data.mfdata[(model_name, "npf", "griddata", "k")]
524+
hk = sim.simulation_data.mfdata[model_name, "npf", "griddata", "k"]
525525

526526
# get specific yield data object from the storage package
527527
sy = sto_package.sy

.docs/Notebooks/lake_example.py renamed to .docs/Notebooks/mf_boundaries_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# section: mf2005
1515
# ---
1616

17-
# # Lake Package Example
17+
# # MODFLOW Boundaries Example
1818
#
1919
# First set the path and import the required packages. The flopy path doesn't have to be set if you install flopy from a binary installer. If you want to run this notebook, you have to set the path to your own flopy path.
2020

.docs/Notebooks/mf6_mnw2_tutorial01.py renamed to .docs/Notebooks/mf_mnw2_tutorial01.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# language: python
1212
# name: python3
1313
# metadata:
14-
# section: mf6
14+
# section: mf2005
1515
# ---
1616

1717
# # Working with the Multi-node Well (MNW2) Package

.docs/Notebooks/mf6_sfr_tutorial01.py renamed to .docs/Notebooks/mf_sfr_tutorial01.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# language: python
1212
# name: python3
1313
# metadata:
14-
# section: mf6
14+
# section: mf2005
1515
# ---
1616

1717
# # SFR2 package loading and querying

.docs/Notebooks/mf_tutorial02.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
stress_period_data = {}
177177
for kper in range(nper):
178178
for kstp in range(nstp[kper]):
179-
stress_period_data[(kper, kstp)] = [
179+
stress_period_data[kper, kstp] = [
180180
"save head",
181181
"save drawdown",
182182
"save budget",

.docs/Notebooks/mfusg_conduit_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
spd = {}
8686
for i in range(mf.nper):
8787
for j in range(mf.dis.nstp[i]):
88-
spd[(i, j)] = ["save head", "save budget"]
88+
spd[i, j] = ["save head", "save budget"]
8989

9090
oc = flopy.modflow.ModflowOc(mf, stress_period_data=spd, unitnumber=[22, 30, 31, 50])
9191

@@ -240,7 +240,7 @@
240240
spd = {}
241241
for i in range(mf.nper):
242242
for j in range(mf.dis.nstp[i]):
243-
spd[(i, j)] = ["save head", "save budget"]
243+
spd[i, j] = ["save head", "save budget"]
244244

245245
oc = flopy.modflow.ModflowOc(mf, stress_period_data=spd)
246246

0 commit comments

Comments
 (0)