Skip to content

Commit

Permalink
remove plotModel option
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jan 11, 2024
1 parent c7da3b3 commit a69fbce
Show file tree
Hide file tree
Showing 59 changed files with 472 additions and 742 deletions.
9 changes: 3 additions & 6 deletions scripts/ex-gwf-advtidal.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import numpy as np
from flopy.plot.styles import styles
from flopy.utils.gridintersect import GridIntersect
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed
from shapely.geometry import Polygon

# Simulation name and workspace
Expand All @@ -33,9 +33,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Model units

Expand Down Expand Up @@ -457,8 +456,6 @@ def plot_ts(sim):


def plot_results(sim, silent=True):
if not plotModel:
return
plot_grid(sim)
plot_ts(sim)

Expand Down
10 changes: 3 additions & 7 deletions scripts/ex-gwf-bcf2ss.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import matplotlib.pyplot as plt
import numpy as np
from flopy.plot.styles import styles
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed

# Simulation name and workspace

Expand All @@ -29,9 +29,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Model units

Expand Down Expand Up @@ -372,9 +371,6 @@ def plot_simulated_results(num, gwf, ho, co, silent=True):


def plot_results(silent=True):
if not plotModel:
return

if silent:
verbosity_level = 0
else:
Expand Down
14 changes: 4 additions & 10 deletions scripts/ex-gwf-bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import matplotlib.pyplot as plt
import numpy as np
from flopy.plot.styles import styles
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed

# Set figure properties

Expand All @@ -35,9 +35,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Scenario parameters

Expand Down Expand Up @@ -327,13 +326,8 @@ def plot_grid(gwf, silent=True):


def plot_results(idx, sim, silent=True):
if not plotModel:
return

with styles.USGSMap() as fs:
name = list(parameters.keys())[idx]
with styles.USGSMap():
gwf = sim.get_model(sim_name)

bot = gwf.dis.botm.array

if idx == 0:
Expand Down
10 changes: 3 additions & 7 deletions scripts/ex-gwf-capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import modflowapi
import numpy as np
from flopy.plot.styles import styles
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed

# Simulation name and workspace

Expand All @@ -34,9 +34,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Model units

Expand Down Expand Up @@ -304,9 +303,6 @@ def run_model():


def plot_results(silent=True):
if not plotModel:
return

if silent:
verbosity_level = 0
else:
Expand Down
14 changes: 5 additions & 9 deletions scripts/ex-gwf-csub-p01.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import matplotlib.pyplot as plt
import numpy as np
from flopy.plot.styles import styles
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed

# Simulation name and workspace

Expand All @@ -31,9 +31,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Model units

Expand Down Expand Up @@ -228,7 +227,7 @@ def write_model(sim, silent=True):
def run_model(sim, silent=True):
if not runModel:
return
success, buff = sim.run_simulation(silent=silent)
success, buff = sim.run_simulation(silent=silent, report=True)
assert success, buff


Expand All @@ -237,10 +236,7 @@ def run_model(sim, silent=True):


def plot_results(sim, silent=True):
if not plotModel:
return

with styles.USGSMap() as fs:
with styles.USGSMap():
gwf = sim.get_model(sim_name)

# plot the grid
Expand Down
10 changes: 3 additions & 7 deletions scripts/ex-gwf-csub-p02.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import matplotlib.pyplot as plt
import numpy as np
from flopy.plot.styles import styles
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed

# Set figure properties specific to the problem

Expand All @@ -28,9 +28,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Simulation name and workspace

Expand Down Expand Up @@ -786,10 +785,7 @@ def plot_head_comparison(sim, silent=True):


def plot_results(sim, silent=True):
if not plotModel:
return
name = sim.name

if name.endswith("a"):
plot_grid(sim, silent=silent)
plot_head_based(sim, silent=silent)
Expand Down
18 changes: 8 additions & 10 deletions scripts/ex-gwf-csub-p03.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from flopy.plot.styles import styles
from modflow_devtools.latex import (build_table, exp_format, float_format,
int_format)
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed

# Set figure properties specific to the problem

Expand All @@ -39,9 +39,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Load the constant time series

Expand Down Expand Up @@ -1677,12 +1676,11 @@ def build_head_data(df, year=1908):


def plot_results(silent=True):
if plotModel:
plot_grid(silent=silent)
plot_boundary_heads(silent=silent)
plot_head_es_comparison(silent=silent)
plot_calibration(silent=silent)
plot_vertical_head()
plot_grid(silent=silent)
plot_boundary_heads(silent=silent)
plot_head_es_comparison(silent=silent)
plot_calibration(silent=silent)
plot_vertical_head()


# Function that wraps all of the steps for the model
Expand Down
14 changes: 6 additions & 8 deletions scripts/ex-gwf-csub-p04.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import matplotlib.pyplot as plt
import numpy as np
from flopy.plot.styles import styles
from modflow_devtools.misc import is_in_ci, timed
from modflow_devtools.misc import timed

# Base simulation and model name and workspace

Expand All @@ -30,9 +30,8 @@
# Configuration

runModel = str(environ.get("RUN", True)).lower() == "true"
plotModel = str(environ.get("PLOT", True)).lower() == "true"
plotSave = str(environ.get("SAVE", is_in_ci())).lower() == "true"
createGif = str(environ.get("GIF", False)).lower() == "true"
plotSave = str(environ.get("SAVE", True)).lower() == "true"
createGif = str(environ.get("GIF", True)).lower() == "true"

# Set figure properties specific to the problem

Expand Down Expand Up @@ -846,10 +845,9 @@ def plot_compaction(sim, silent=True):


def plot_results(sim, silent=True):
if plotModel:
plot_grid(sim, silent=silent)
plot_stresses(sim, silent=silent)
plot_compaction(sim, silent=silent)
plot_grid(sim, silent=silent)
plot_stresses(sim, silent=silent)
plot_compaction(sim, silent=silent)


# Function that wraps all of the steps for the model
Expand Down
Loading

0 comments on commit a69fbce

Please sign in to comment.