Skip to content

Commit

Permalink
fix(tutorial, verbosity setter): fixed tutorial model name and verbos…
Browse files Browse the repository at this point in the history
…ity setter (#2182) (#2193)
  • Loading branch information
scottrp committed May 21, 2024
1 parent 29e247d commit 7879c2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .docs/Notebooks/mf6_data_tutorial01.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

temp_dir = TemporaryDirectory()
workspace = temp_dir.name
name = "tutorial01_mf6_data"
name = "tutorial01"

# set up simulation and basic packages
sim = flopy.mf6.MFSimulation(sim_name=name, sim_ws=workspace)
Expand All @@ -56,7 +56,8 @@
)
flopy.mf6.ModflowIms(sim)
gwf = flopy.mf6.ModflowGwf(sim, modelname=name, save_flows=True)
flopy.mf6.ModflowGwfdis(gwf, nlay=3, nrow=4, ncol=5)
botm = [30.0, 20.0, 10.0]
flopy.mf6.ModflowGwfdis(gwf, nlay=3, nrow=4, ncol=5, top=50.0, botm=botm)
flopy.mf6.ModflowGwfic(gwf)
flopy.mf6.ModflowGwfnpf(gwf, save_specific_discharge=True)
flopy.mf6.ModflowGwfchd(
Expand Down
13 changes: 12 additions & 1 deletion flopy/mf6/mfsimbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def __init__(self, path: Union[str, os.PathLike], mfsim):
self.verify_data = True
self.debug = False
self.verbose = True
self.verbosity_level = VerbosityLevel.normal
self._verbosity_level = VerbosityLevel.normal
self.max_columns_user_set = False
self.max_columns_auto_set = False
self.use_pandas = True
Expand All @@ -275,6 +275,17 @@ def __init__(self, path: Union[str, os.PathLike], mfsim):
# other external files referenced
self.referenced_files = {}

@property
def verbosity_level(self):
return self._verbosity_level

@verbosity_level.setter
def verbosity_level(self, val):
if isinstance(val, VerbosityLevel):
self._verbosity_level = val
elif isinstance(val, int):
self._verbosity_level = VerbosityLevel(val)

@property
def lazy_io(self):
if not self.auto_set_sizes and not self.verify_data:
Expand Down

0 comments on commit 7879c2f

Please sign in to comment.