Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tutorial, verbosity setter): fixed tutorial model name and verbosity setter (#2182) #2193

Merged
merged 1 commit into from
May 21, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading