From a69fbce07e98008f1f291185b3a5721e35cd57cc Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Thu, 11 Jan 2024 10:28:50 -0500 Subject: [PATCH] remove plotModel option --- scripts/ex-gwf-advtidal.py | 9 +- scripts/ex-gwf-bcf2ss.py | 10 +- scripts/ex-gwf-bump.py | 14 +- scripts/ex-gwf-capture.py | 10 +- scripts/ex-gwf-csub-p01.py | 14 +- scripts/ex-gwf-csub-p02.py | 10 +- scripts/ex-gwf-csub-p03.py | 18 +- scripts/ex-gwf-csub-p04.py | 14 +- scripts/ex-gwf-curvilinear-90.py | 43 ++--- scripts/ex-gwf-curvilinear.py | 16 +- scripts/ex-gwf-disvmesh.py | 14 +- scripts/ex-gwf-drn-p01.py | 12 +- scripts/ex-gwf-fhb.py | 12 +- scripts/ex-gwf-hani.py | 14 +- scripts/ex-gwf-lak-p01.py | 16 +- scripts/ex-gwf-lak-p02.py | 14 +- scripts/ex-gwf-lgr.py | 15 +- scripts/ex-gwf-lgrv.py | 18 +- scripts/ex-gwf-maw-p01.py | 12 +- scripts/ex-gwf-maw-p02.py | 12 +- scripts/ex-gwf-maw-p03.py | 15 +- scripts/ex-gwf-nwt-p02.py | 12 +- scripts/ex-gwf-nwt-p03.py | 12 +- scripts/ex-gwf-radial.py | 16 +- scripts/ex-gwf-sagehen.py | 12 +- scripts/ex-gwf-sfr-p01.py | 19 +- scripts/ex-gwf-sfr-p01b.py | 22 +-- scripts/ex-gwf-spbc.py | 27 ++- scripts/ex-gwf-twri.py | 12 +- scripts/ex-gwf-u1disv.py | 14 +- scripts/ex-gwf-u1gwfgwf.py | 16 +- scripts/ex-gwf-whirl.py | 10 +- scripts/ex-gwf-zaidel.py | 12 +- scripts/ex-gwt-gwtgwt-p10.py | 16 +- scripts/ex-gwt-hecht-mendez.py | 283 ++++++++++++++--------------- scripts/ex-gwt-henry.py | 13 +- scripts/ex-gwt-keating.py | 23 +-- scripts/ex-gwt-moc3d-p01.py | 21 +-- scripts/ex-gwt-moc3d-p02.py | 16 +- scripts/ex-gwt-moc3d-p02tg.py | 21 +-- scripts/ex-gwt-mt3dms-p01.py | 11 +- scripts/ex-gwt-mt3dms-p02.py | 22 +-- scripts/ex-gwt-mt3dms-p03.py | 11 +- scripts/ex-gwt-mt3dms-p04.py | 11 +- scripts/ex-gwt-mt3dms-p05.py | 11 +- scripts/ex-gwt-mt3dms-p06.py | 17 +- scripts/ex-gwt-mt3dms-p07.py | 11 +- scripts/ex-gwt-mt3dms-p08.py | 12 +- scripts/ex-gwt-mt3dms-p09.py | 12 +- scripts/ex-gwt-mt3dms-p10.py | 10 +- scripts/ex-gwt-mt3dsupp631.py | 13 +- scripts/ex-gwt-mt3dsupp632.py | 19 +- scripts/ex-gwt-mt3dsupp82.py | 10 +- scripts/ex-gwt-prudic2004t2.py | 90 +++++---- scripts/ex-gwt-rotate.py | 16 +- scripts/ex-gwt-saltlake.py | 14 +- scripts/ex-gwt-stallman.py | 16 +- scripts/ex-gwt-synthetic-valley.py | 9 +- scripts/ex-gwt-uzt-2d.py | 10 +- 59 files changed, 472 insertions(+), 742 deletions(-) diff --git a/scripts/ex-gwf-advtidal.py b/scripts/ex-gwf-advtidal.py index 3023a331..538b743a 100644 --- a/scripts/ex-gwf-advtidal.py +++ b/scripts/ex-gwf-advtidal.py @@ -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 @@ -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 @@ -457,8 +456,6 @@ def plot_ts(sim): def plot_results(sim, silent=True): - if not plotModel: - return plot_grid(sim) plot_ts(sim) diff --git a/scripts/ex-gwf-bcf2ss.py b/scripts/ex-gwf-bcf2ss.py index fce52821..c2c004ce 100644 --- a/scripts/ex-gwf-bcf2ss.py +++ b/scripts/ex-gwf-bcf2ss.py @@ -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 @@ -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 @@ -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: diff --git a/scripts/ex-gwf-bump.py b/scripts/ex-gwf-bump.py index 59f7e50f..4d14cc0b 100644 --- a/scripts/ex-gwf-bump.py +++ b/scripts/ex-gwf-bump.py @@ -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 @@ -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 @@ -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: diff --git a/scripts/ex-gwf-capture.py b/scripts/ex-gwf-capture.py index 3b408419..4b6565ff 100644 --- a/scripts/ex-gwf-capture.py +++ b/scripts/ex-gwf-capture.py @@ -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 @@ -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 @@ -304,9 +303,6 @@ def run_model(): def plot_results(silent=True): - if not plotModel: - return - if silent: verbosity_level = 0 else: diff --git a/scripts/ex-gwf-csub-p01.py b/scripts/ex-gwf-csub-p01.py index ba6ce703..cf34076c 100644 --- a/scripts/ex-gwf-csub-p01.py +++ b/scripts/ex-gwf-csub-p01.py @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/scripts/ex-gwf-csub-p02.py b/scripts/ex-gwf-csub-p02.py index ce501cb4..bd7bcd8f 100644 --- a/scripts/ex-gwf-csub-p02.py +++ b/scripts/ex-gwf-csub-p02.py @@ -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 @@ -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 @@ -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) diff --git a/scripts/ex-gwf-csub-p03.py b/scripts/ex-gwf-csub-p03.py index 78aaa81c..39df8b84 100644 --- a/scripts/ex-gwf-csub-p03.py +++ b/scripts/ex-gwf-csub-p03.py @@ -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 @@ -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 @@ -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 diff --git a/scripts/ex-gwf-csub-p04.py b/scripts/ex-gwf-csub-p04.py index a9c79bdf..a66d647b 100644 --- a/scripts/ex-gwf-csub-p04.py +++ b/scripts/ex-gwf-csub-p04.py @@ -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 @@ -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 @@ -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 diff --git a/scripts/ex-gwf-curvilinear-90.py b/scripts/ex-gwf-curvilinear-90.py index 87aea58b..eafb998b 100644 --- a/scripts/ex-gwf-curvilinear-90.py +++ b/scripts/ex-gwf-curvilinear-90.py @@ -20,13 +20,14 @@ import os import pathlib as pl from math import sqrt +from itertools import cycle from os import environ import flopy 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 # Curvilinear grid @@ -2169,9 +2170,8 @@ def analytical_model(r1, h1, r2, h2, r): # 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 @@ -2352,7 +2352,7 @@ def run_model(sim, silent=True): def plot_grid(sim, verbose=False): - with styles.USGSMap() as fs: + with styles.USGSMap(): gwf = sim.get_model(sim_name) fig = plt.figure(figsize=figure_size_grid) @@ -2401,11 +2401,9 @@ def plot_grid(sim, verbose=False): def plot_head(sim): - with styles.USGSMap() as fs: + with styles.USGSMap(): gwf = sim.get_model(sim_name) - fig = plt.figure(figsize=figure_size_head) - head = gwf.output.head().get_data()[:, 0, :] # create MODFLOW 6 cell-by-cell budget object @@ -2438,15 +2436,10 @@ def plot_head(sim): def plot_analytical(sim, verbose=False): gwf = sim.get_model(sim_name) - head = gwf.output.head().get_data()[:, 0, :] - col = ncol // 2 - 1 # Get head along middle of model - head = [head[0, curvlin.get_cellid(rad, col)] for rad in range(nradial)] - xrad = [0.5 * (radii[r - 1] + radii[r]) for r in range(1, nradial + 1)] - analytical = [head[0]] r1 = xrad[0] r2 = xrad[-1] @@ -2465,11 +2458,8 @@ def plot_analytical(sim, verbose=False): ax.set_ylabel("Head (ft)") ax.plot(xrad, head, "ob", label="MF6 Solution", markerfacecolor="none") ax.plot(xrad, analytical, "-b", label="Analytical Solution") - styles.graph_legend(ax) - fig.tight_layout() - if plotSave: fpth = os.path.join( "..", @@ -2483,9 +2473,6 @@ def plot_analytical(sim, verbose=False): def plot_results(silent=True): - if not plotModel: - return - if silent: verbosity_level = 0 else: @@ -2497,11 +2484,9 @@ def plot_results(silent=True): ) verbose = not silent - - if plotModel: - plot_grid(sim, verbose) - plot_head(sim) - plot_analytical(sim, verbose) + plot_grid(sim, verbose) + plot_head(sim) + plot_analytical(sim, verbose) def calculate_model_error(): @@ -2511,11 +2496,8 @@ def calculate_model_error(): ) gwf = sim.get_model(sim_name) - head = gwf.output.head().get_data()[0, 0, :] - xrad = [0.5 * (radii[r - 1] + radii[r]) for r in range(1, nradial + 1)] - analytical = [head[0]] r1 = xrad[0] r2 = xrad[-1] @@ -2544,9 +2526,10 @@ def calculate_model_error(): def check_model_error(): - if runModel: - rel_error, rmse = calculate_model_error() - assert rel_error < 0.001 + if not runModel: + return + rel_error, rmse = calculate_model_error() + assert rel_error < 0.001 # Function that wraps all of the steps for the curvilinear model diff --git a/scripts/ex-gwf-curvilinear.py b/scripts/ex-gwf-curvilinear.py index b38e6edb..532009ef 100644 --- a/scripts/ex-gwf-curvilinear.py +++ b/scripts/ex-gwf-curvilinear.py @@ -26,7 +26,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 # Curvilinear grid @@ -2160,9 +2160,8 @@ def calc_curvilinear_ncol(angle_start, angle_stop, angle_step): # 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 @@ -2625,9 +2624,6 @@ def plot_head(sim): def plot_results(silent=True): - if not plotModel: - return - if silent: verbosity_level = 0 else: @@ -2639,10 +2635,8 @@ def plot_results(silent=True): ) verbose = not silent - - if plotModel: - plot_grid(sim, verbose) - plot_head(sim) + plot_grid(sim, verbose) + plot_head(sim) # Function that wraps all of the steps for the curvilinear model diff --git a/scripts/ex-gwf-disvmesh.py b/scripts/ex-gwf-disvmesh.py index b471f722..dfe802a0 100644 --- a/scripts/ex-gwf-disvmesh.py +++ b/scripts/ex-gwf-disvmesh.py @@ -22,7 +22,7 @@ from flopy.plot.styles import styles from flopy.utils.geometry import get_polygon_area 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 # Set default figure properties @@ -37,9 +37,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 @@ -303,10 +302,9 @@ def plot_head(idx, sim): def plot_results(idx, sim, silent=True): - if plotModel: - if idx == 0: - plot_grid(idx, sim) - plot_head(idx, sim) + if idx == 0: + plot_grid(idx, sim) + plot_head(idx, sim) # Function that wraps all of the steps for the FHB model diff --git a/scripts/ex-gwf-drn-p01.py b/scripts/ex-gwf-drn-p01.py index 7dbb5648..279eda0d 100644 --- a/scripts/ex-gwf-drn-p01.py +++ b/scripts/ex-gwf-drn-p01.py @@ -19,7 +19,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 @@ -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" # Model units @@ -1268,9 +1267,8 @@ def export_tables(silent=True): def plot_results(silent=True): - if plotModel: - plot_gwseep_results(silent=silent) - export_tables(silent=silent) + plot_gwseep_results(silent=silent) + export_tables(silent=silent) # Function that wraps all of the steps for the UZF Package Problem 2 model diff --git a/scripts/ex-gwf-fhb.py b/scripts/ex-gwf-fhb.py index c5897f31..649eed24 100644 --- a/scripts/ex-gwf-fhb.py +++ b/scripts/ex-gwf-fhb.py @@ -17,7 +17,7 @@ import flopy import matplotlib.pyplot as plt from flopy.plot.styles import styles -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed # Set default figure properties @@ -32,9 +32,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 @@ -257,9 +256,8 @@ def plot_ts(sim): def plot_results(sim, silent=True): - if plotModel: - plot_grid(sim) - plot_ts(sim) + plot_grid(sim) + plot_ts(sim) # Function that wraps all of the steps for the FHB model diff --git a/scripts/ex-gwf-hani.py b/scripts/ex-gwf-hani.py index 3e51ae40..179f1055 100644 --- a/scripts/ex-gwf-hani.py +++ b/scripts/ex-gwf-hani.py @@ -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 # Set default figure properties @@ -32,9 +32,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 @@ -215,10 +214,9 @@ def plot_head(idx, sim): def plot_results(idx, sim, silent=True): - if plotModel: - if idx == 0: - plot_grid(idx, sim) - plot_head(idx, sim) + if idx == 0: + plot_grid(idx, sim) + plot_head(idx, sim) # Function that wraps all of the steps for the FHB model diff --git a/scripts/ex-gwf-lak-p01.py b/scripts/ex-gwf-lak-p01.py index b30c9a3d..3863371e 100644 --- a/scripts/ex-gwf-lak-p01.py +++ b/scripts/ex-gwf-lak-p01.py @@ -16,7 +16,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 @@ -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 @@ -565,12 +564,9 @@ def plot_lak_results(gwf, silent=True): def plot_results(sim, silent=True): - if plotModel: - gwf = sim.get_model(sim_name) - - plot_grid(gwf, silent=silent) - - plot_lak_results(gwf, silent=silent) + gwf = sim.get_model(sim_name) + plot_grid(gwf, silent=silent) + plot_lak_results(gwf, silent=silent) # Function that wraps all of the steps for the LAK Package Problem 1 model diff --git a/scripts/ex-gwf-lak-p02.py b/scripts/ex-gwf-lak-p02.py index 96104d24..864f68ef 100644 --- a/scripts/ex-gwf-lak-p02.py +++ b/scripts/ex-gwf-lak-p02.py @@ -17,7 +17,7 @@ import numpy as np import shapefile as shp 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 @@ -32,9 +32,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 @@ -1119,10 +1118,9 @@ def plot_lak_results(gwf, silent=True): def plot_results(sim, silent=True): - if plotModel: - gwf = sim.get_model(sim_name) - plot_grid(gwf, silent=silent) - plot_lak_results(gwf, silent=silent) + gwf = sim.get_model(sim_name) + plot_grid(gwf, silent=silent) + plot_lak_results(gwf, silent=silent) # Function that wraps all of the steps for the LAK Package problem 2 model diff --git a/scripts/ex-gwf-lgr.py b/scripts/ex-gwf-lgr.py index f0d36de3..b7f1436f 100644 --- a/scripts/ex-gwf-lgr.py +++ b/scripts/ex-gwf-lgr.py @@ -15,7 +15,7 @@ import numpy as np from flopy.plot.styles import styles from flopy.utils.lgrutil import Lgr -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed mf6exe = "mf6" exe_name_mf = "mf2005" @@ -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 @@ -851,7 +850,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 @@ -859,12 +858,8 @@ def run_model(sim, silent=True): def plot_results(mf6, idx): - if not plotModel: - return - - print("Plotting model results...") sim_name = mf6.name - with styles.USGSPlot() as fs: + with styles.USGSPlot(): # Start by retrieving some output mf6_out_pth = mf6.simulation_data.mfpath.get_sim_path() sfr_parent_bud_file = list(mf6.model_names)[0] + ".sfr.bud" diff --git a/scripts/ex-gwf-lgrv.py b/scripts/ex-gwf-lgrv.py index 093db966..6863d952 100644 --- a/scripts/ex-gwf-lgrv.py +++ b/scripts/ex-gwf-lgrv.py @@ -17,7 +17,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 default figure properties @@ -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 @@ -446,8 +445,7 @@ def run_model(sim, silent=False): # Function to plot the LGRV model results. # def plot_grid(sim): - print(f"Plotting grid for {sim.name}...") - with styles.USGSMap() as fs: + with styles.USGSMap(): sim_name = sim.name gwf = sim.get_model("parent") gwfc = None @@ -585,11 +583,9 @@ def plot_heads(sim): def plot_results(sim, silent=True): - if plotModel: - plot_grid(sim) - plot_xsect(sim) - plot_heads(sim) - return + plot_grid(sim) + plot_xsect(sim) + plot_heads(sim) # Function that wraps all of the steps for the LGRV model diff --git a/scripts/ex-gwf-maw-p01.py b/scripts/ex-gwf-maw-p01.py index a01b1dbb..8815c09e 100644 --- a/scripts/ex-gwf-maw-p01.py +++ b/scripts/ex-gwf-maw-p01.py @@ -17,7 +17,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 @@ -32,9 +32,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 @@ -412,9 +411,8 @@ def plot_grid(silent=True): def plot_results(silent=True): - if plotModel: - plot_grid(silent=silent) - plot_maw_results(silent=silent) + plot_grid(silent=silent) + plot_maw_results(silent=silent) # Function that wraps all of the steps for the Neville-Tonkin MAW Problem model diff --git a/scripts/ex-gwf-maw-p02.py b/scripts/ex-gwf-maw-p02.py index 0dfe704d..b43870e4 100644 --- a/scripts/ex-gwf-maw-p02.py +++ b/scripts/ex-gwf-maw-p02.py @@ -17,7 +17,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 @@ -32,9 +32,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 @@ -396,9 +395,8 @@ def plot_grid(sim, silent=True): def plot_results(sim, silent=True): - if plotModel: - plot_grid(sim, silent=silent) - plot_maw_results(silent=silent) + plot_grid(sim, silent=silent) + plot_maw_results(silent=silent) # Function that wraps all of the steps for the Flowing Well Problem model diff --git a/scripts/ex-gwf-maw-p03.py b/scripts/ex-gwf-maw-p03.py index 3b93e86f..321c7622 100644 --- a/scripts/ex-gwf-maw-p03.py +++ b/scripts/ex-gwf-maw-p03.py @@ -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 specific to the @@ -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 @@ -833,11 +832,9 @@ def plot_local_grid(silent=True): def plot_results(silent=True): - if plotModel: - plot_regional_grid(silent=silent) - plot_local_grid(silent=silent) - plot_maw_results(silent=silent) - pass + plot_regional_grid(silent=silent) + plot_local_grid(silent=silent) + plot_maw_results(silent=silent) # Function that wraps all of the steps for the Reilly MAW Problem model diff --git a/scripts/ex-gwf-nwt-p02.py b/scripts/ex-gwf-nwt-p02.py index 5d0ab8bf..fca39529 100644 --- a/scripts/ex-gwf-nwt-p02.py +++ b/scripts/ex-gwf-nwt-p02.py @@ -14,7 +14,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 @@ -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 @@ -245,10 +244,7 @@ def plot_results(silent=True): else: verbosity_level = 0 - if not plotModel: - return - - with styles.USGSMap() as fs: + with styles.USGSMap(): # load the newton model name = list(parameters.keys())[0] sim_ws = os.path.join(ws, name) diff --git a/scripts/ex-gwf-nwt-p03.py b/scripts/ex-gwf-nwt-p03.py index c3ec315a..ff9abc0f 100644 --- a/scripts/ex-gwf-nwt-p03.py +++ b/scripts/ex-gwf-nwt-p03.py @@ -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 @@ -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" # Model units @@ -400,10 +399,7 @@ def plot_recharge(gwf, silent=True): def plot_results(idx, sim, silent=True): - if not plotModel: - return - - with styles.USGSMap() as fs: + with styles.USGSMap(): name = list(parameters.keys())[idx] gwf = sim.get_model(sim_name) diff --git a/scripts/ex-gwf-radial.py b/scripts/ex-gwf-radial.py index af276a6e..2ac4c258 100644 --- a/scripts/ex-gwf-radial.py +++ b/scripts/ex-gwf-radial.py @@ -25,7 +25,7 @@ import numpy as np from flopy.plot.styles import styles from matplotlib.patches import Circle -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed # Solve definite integral using Fortran library QUADPACK from scipy.integrate import quad # Find a root of a function using Brent's method within a bracketed range @@ -1058,9 +1058,8 @@ def get_radius_lay_from_node(node, nradial): 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 @@ -1961,9 +1960,6 @@ def plot_grid(verbose=False): def plot_results(silent=True): - if not plotModel: - return - if silent: verbosity_level = 0 else: @@ -1975,10 +1971,8 @@ def plot_results(silent=True): ) verbose = not silent - - if plotModel: - plot_grid(verbose) - plot_ts(sim, verbose, solve_analytical_solution=solve_analytical_solution) + plot_grid(verbose) + plot_ts(sim, verbose, solve_analytical_solution=solve_analytical_solution) # Function that wraps all of the steps for the Axisymmetric model diff --git a/scripts/ex-gwf-sagehen.py b/scripts/ex-gwf-sagehen.py index cc5ef909..d5726922 100644 --- a/scripts/ex-gwf-sagehen.py +++ b/scripts/ex-gwf-sagehen.py @@ -15,7 +15,7 @@ import numpy as np import pandas as pd from flopy.plot.styles import styles -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed mf6exe = "mf6" exe_name_mf = "mf2005" @@ -465,9 +465,8 @@ def determine_runoff_conns_4mvr(pth, elev_arr, ibnd, orig_rch, nrow, ncol): # 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 @@ -2066,12 +2065,7 @@ def run_model(sim, silent=True): def plot_results(mf6): - if not plotModel: - return - - print("Plotting model results...") sim_name = mf6.name - with styles.USGSPlot(): # Generate a plot of FINF distribution finf_plt = finf_grad.copy() diff --git a/scripts/ex-gwf-sfr-p01.py b/scripts/ex-gwf-sfr-p01.py index 0b573ec0..ae1585f6 100644 --- a/scripts/ex-gwf-sfr-p01.py +++ b/scripts/ex-gwf-sfr-p01.py @@ -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 @@ -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 @@ -1291,14 +1290,10 @@ def plot_sfr_results(gwf, silent=True): def plot_results(sim, silent=True): - if plotModel: - gwf = sim.get_model(sim_name) - - plot_grid(gwf, silent=silent) - - plot_sfr_results(gwf, silent=silent) - - plot_head_results(gwf, silent=silent) + gwf = sim.get_model(sim_name) + plot_grid(gwf, silent=silent) + plot_sfr_results(gwf, silent=silent) + plot_head_results(gwf, silent=silent) # Function that wraps all of the steps for the SFR Package Problem 1 model diff --git a/scripts/ex-gwf-sfr-p01b.py b/scripts/ex-gwf-sfr-p01b.py index 1ce641b6..71240997 100644 --- a/scripts/ex-gwf-sfr-p01b.py +++ b/scripts/ex-gwf-sfr-p01b.py @@ -20,7 +20,7 @@ import numpy as np import pandas as pd 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 @@ -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" # Model units @@ -4540,16 +4539,11 @@ def plot_uzfcolumn_results(idx, gwf, silent=True): def plot_results(idx, sim, silent=True): - if plotModel: - gwf = sim.get_model(sim_name) - - plot_grid(gwf, silent=silent) - - plot_head_results(gwf, silent=silent) - - plot_mvr_results(idx, gwf, silent=silent) - - plot_uzfcolumn_results(idx, gwf, silent=silent) + gwf = sim.get_model(sim_name) + plot_grid(gwf, silent=silent) + plot_head_results(gwf, silent=silent) + plot_mvr_results(idx, gwf, silent=silent) + plot_uzfcolumn_results(idx, gwf, silent=silent) # Function that wraps all of the steps for the SFR Package Problem 1 model diff --git a/scripts/ex-gwf-spbc.py b/scripts/ex-gwf-spbc.py index b216b055..0dbae443 100644 --- a/scripts/ex-gwf-spbc.py +++ b/scripts/ex-gwf-spbc.py @@ -17,7 +17,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 default figure properties @@ -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 @@ -166,18 +165,16 @@ def write_model(sim, silent=True): @timed def run_model(sim, silent=False): - success = True - if runModel: - success, buff = sim.run_simulation(silent=silent, report=True) - if not success: - print(buff) - return success + if not runModel: + return + success, buff = sim.run_simulation(silent=silent, report=True) + assert success, buff # Function to plot the SPBC model results. # def plot_grid(sim): - with styles.USGSMap() as fs: + with styles.USGSMap(): gwf = sim.get_model(sim_name) fig = plt.figure(figsize=figure_size) @@ -215,8 +212,7 @@ def plot_grid(sim): def plot_results(sim, silent=True): - if plotModel: - plot_grid(sim) + plot_grid(sim) # Function that wraps all of the steps for the SPBC model @@ -231,9 +227,8 @@ def plot_results(sim, silent=True): def simulation(silent=True): sim = build_model() write_model(sim, silent=silent) - success = run_model(sim, silent=silent) - if success: - plot_results(sim, silent=silent) + run_model(sim, silent=silent) + plot_results(sim, silent=silent) # ### SPBC Simulation diff --git a/scripts/ex-gwf-twri.py b/scripts/ex-gwf-twri.py index 9b0b4908..09b19ce5 100644 --- a/scripts/ex-gwf-twri.py +++ b/scripts/ex-gwf-twri.py @@ -17,7 +17,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 @@ -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" # Scenario parameter units - make sure there is at least one blank line before next item # add parameter_units to add units to the scenario parameter table @@ -281,10 +280,7 @@ def run_model(sim, mf, silent=True): def plot_results(sim, mf, silent=True): - if not plotModel: - return - - with styles.USGSMap() as fs: + with styles.USGSMap(): sim_ws = os.path.join(ws, sim_name) gwf = sim.get_model(sim_name) diff --git a/scripts/ex-gwf-u1disv.py b/scripts/ex-gwf-u1disv.py index 97a704a8..bcfa51b1 100644 --- a/scripts/ex-gwf-u1disv.py +++ b/scripts/ex-gwf-u1disv.py @@ -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 # Set default figure properties @@ -32,9 +32,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 @@ -304,10 +303,9 @@ def plot_head(idx, sim): def plot_results(idx, sim, silent=True): - if plotModel: - if idx == 0: - plot_grid(idx, sim) - plot_head(idx, sim) + if idx == 0: + plot_grid(idx, sim) + plot_head(idx, sim) # Function that wraps all of the steps for the FHB model diff --git a/scripts/ex-gwf-u1gwfgwf.py b/scripts/ex-gwf-u1gwfgwf.py index b237a739..f9ebc1ac 100644 --- a/scripts/ex-gwf-u1gwfgwf.py +++ b/scripts/ex-gwf-u1gwfgwf.py @@ -27,7 +27,7 @@ from flopy.plot.styles import styles from flopy.utils.lgrutil import Lgr from matplotlib.colors import ListedColormap -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed # Set default figure properties @@ -41,9 +41,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 @@ -547,11 +546,10 @@ def plot_head(idx, sim): def plot_results(idx, sim, silent=True): - if plotModel: - if idx == 0: - plot_grid(idx, sim) - plot_stencils(idx, sim) - plot_head(idx, sim) + if idx == 0: + plot_grid(idx, sim) + plot_stencils(idx, sim) + plot_head(idx, sim) # Function that wraps all of the steps for the FHB model diff --git a/scripts/ex-gwf-whirl.py b/scripts/ex-gwf-whirl.py index 60ea3633..21043c8e 100644 --- a/scripts/ex-gwf-whirl.py +++ b/scripts/ex-gwf-whirl.py @@ -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 default figure properties @@ -32,9 +32,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 @@ -195,8 +194,7 @@ def plot_spdis(sim): def plot_results(sim, silent=True): - if plotModel: - plot_spdis(sim) + plot_spdis(sim) # Function that wraps all of the steps for the FHB model diff --git a/scripts/ex-gwf-zaidel.py b/scripts/ex-gwf-zaidel.py index 3c17e223..6817b21a 100644 --- a/scripts/ex-gwf-zaidel.py +++ b/scripts/ex-gwf-zaidel.py @@ -16,7 +16,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 @@ -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" # Model units @@ -161,10 +160,7 @@ def run_model(sim, silent=True): def plot_results(idx, sim, silent=True): - if not plotModel: - return - - with styles.USGSMap() as fs: + with styles.USGSMap(): gwf = sim.get_model(sim_name) xedge = gwf.modelgrid.xvertices[0] zedge = np.array([botm[0, 0, 0]] + botm.flatten().tolist()) diff --git a/scripts/ex-gwt-gwtgwt-p10.py b/scripts/ex-gwt-gwtgwt-p10.py index 581cf3f9..ac0bcc02 100644 --- a/scripts/ex-gwt-gwtgwt-p10.py +++ b/scripts/ex-gwt-gwtgwt-p10.py @@ -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 length_units = "feet" @@ -1198,12 +1197,11 @@ def plot_concentration(sim): # Generates all plots def plot_results(sim): - if plotModel: - print("Plotting model results...") - plot_grids(sim) - plot_concentration(sim) - plot_difference_conc(sim) - plot_difference_heads(sim) + print("Plotting model results...") + plot_grids(sim) + plot_concentration(sim) + plot_difference_conc(sim) + plot_difference_heads(sim) def test_01(): diff --git a/scripts/ex-gwt-hecht-mendez.py b/scripts/ex-gwt-hecht-mendez.py index c8876888..2870cb47 100644 --- a/scripts/ex-gwt-hecht-mendez.py +++ b/scripts/ex-gwt-hecht-mendez.py @@ -31,7 +31,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 from scipy.special import erf, erfc mf6exe = "mf6" @@ -50,9 +50,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 @@ -825,158 +824,156 @@ def plot_results( seepagevelocity=0, constantheadright=14, ): - if plotModel: - print("Plotting model results...") - if mt3d is not None: - mt3d_out_path = mt3d.model_ws - - # Get the MT3DMS concentration output - fname_mt3d = os.path.join(mt3d_out_path, "MT3D001.UCN") - ucnobj_mt3d = flopy.utils.UcnFile(fname_mt3d) - times_mt3d = ucnobj_mt3d.get_times() - conc_mt3d = ucnobj_mt3d.get_alldata() - - mf6_out_path = sim_mf6gwt.simulation_data.mfpath.get_sim_path() - - # Get the MF6 concentration output - gwt = sim_mf6gwt.get_model("gwt-" + name) - ucnobj_mf6 = gwt.output.concentration() - - times_mf6 = ucnobj_mf6.get_times() - conc_mf6 = ucnobj_mf6.get_alldata() - - # Get the x location of the cell centroids - model_centroids_x = [] - for i, (cum_pos, half_width) in enumerate( - zip(np.cumsum(delr), np.divide(delr, 2)) - ): - if i > 0: - model_centroids_x.append(cum_pos - half_width) - else: - model_centroids_x.append(half_width) - - # Next subtract off the location of the BHE - model_centroids_x_BHE = [ - val - model_centroids_x[21] for val in model_centroids_x - ] - # Drop the negative locations to the left of the BHE - model_centroids_x_right_of_BHE = model_centroids_x_BHE[22:] # Does not include - - # Analytical solution(s) - To = T0 # deg K (initial temperature of the ground) - Y3d = 0.1 # m - Z3d = delz # m - ath = al * trpt # m - atv = al * trpv # m - F0 = -60 # W/m - Fplanar = -600 # W/m^2 - va = seepagevelocity - n = prsity # porosity - rhow = 1000.0 # density of water - cw = 4185.0 # heat capacity of water - thermdiff = 1.86e-6 # "molecular diffusion" representing heat - # conduction - - x_pos = np.array(model_centroids_x_right_of_BHE) - ss_sln = hechtMendez_SS_3d( - x_pos, To, Y3d, Z3d, ath, atv, Fplanar, va, n, rhow, cw, thermdiff - ) + if mt3d is not None: + mt3d_out_path = mt3d.model_ws + + # Get the MT3DMS concentration output + fname_mt3d = os.path.join(mt3d_out_path, "MT3D001.UCN") + ucnobj_mt3d = flopy.utils.UcnFile(fname_mt3d) + times_mt3d = ucnobj_mt3d.get_times() + conc_mt3d = ucnobj_mt3d.get_alldata() + + mf6_out_path = sim_mf6gwt.simulation_data.mfpath.get_sim_path() + + # Get the MF6 concentration output + gwt = sim_mf6gwt.get_model("gwt-" + name) + ucnobj_mf6 = gwt.output.concentration() + + times_mf6 = ucnobj_mf6.get_times() + conc_mf6 = ucnobj_mf6.get_alldata() + + # Get the x location of the cell centroids + model_centroids_x = [] + for i, (cum_pos, half_width) in enumerate( + zip(np.cumsum(delr), np.divide(delr, 2)) + ): + if i > 0: + model_centroids_x.append(cum_pos - half_width) + else: + model_centroids_x.append(half_width) + + # Next subtract off the location of the BHE + model_centroids_x_BHE = [ + val - model_centroids_x[21] for val in model_centroids_x + ] + # Drop the negative locations to the left of the BHE + model_centroids_x_right_of_BHE = model_centroids_x_BHE[22:] # Does not include + + # Analytical solution(s) + To = T0 # deg K (initial temperature of the ground) + Y3d = 0.1 # m + Z3d = delz # m + ath = al * trpt # m + atv = al * trpv # m + F0 = -60 # W/m + Fplanar = -600 # W/m^2 + va = seepagevelocity + n = prsity # porosity + rhow = 1000.0 # density of water + cw = 4185.0 # heat capacity of water + thermdiff = 1.86e-6 # "molecular diffusion" representing heat + # conduction + + x_pos = np.array(model_centroids_x_right_of_BHE) + ss_sln = hechtMendez_SS_3d( + x_pos, To, Y3d, Z3d, ath, atv, Fplanar, va, n, rhow, cw, thermdiff + ) - t = 864000 # seconds (10 days) - Y = 0.1 # dimension of source in the y direction - Z = delz # dimension of source in the z direction - R = 2.59 # From Hecht-Mendez manuscript + t = 864000 # seconds (10 days) + Y = 0.1 # dimension of source in the y direction + Z = delz # dimension of source in the z direction + R = 2.59 # From Hecht-Mendez manuscript + + tr_sln = hechtMendez3d( + x_pos, + t, + Y, + Z, + al, + ath, + atv, + thermdiff, + va, + n, + R, + Fplanar, + cw, + rhow, + ) - tr_sln = hechtMendez3d( - x_pos, - t, - Y, - Z, - al, - ath, - atv, - thermdiff, - va, - n, - R, - Fplanar, - cw, - rhow, - ) + # list of where to draw vertical lines + avlines = list(range(10)) + list(range(10, 110, 10)) - # list of where to draw vertical lines - avlines = list(range(10)) + list(range(10, 110, 10)) + # fill variables with analytical solutions + y_ss_anly_sln = ss_sln + y_tr_anly_sln = [285.15 + val for val in tr_sln] - # fill variables with analytical solutions - y_ss_anly_sln = ss_sln - y_tr_anly_sln = [285.15 + val for val in tr_sln] + # fill variables containing the simulated solutions + if mt3d is not None: + y_10_mt_sln = conc_mt3d[0, 6, (42 - 1), 22:] + y_150_mt_sln = conc_mt3d[-1, 6, (42 - 1), 22:] - # fill variables containing the simulated solutions - if mt3d is not None: - y_10_mt_sln = conc_mt3d[0, 6, (42 - 1), 22:] - y_150_mt_sln = conc_mt3d[-1, 6, (42 - 1), 22:] + y_10_mf6_sln = conc_mf6[0, 6, (42 - 1), 22:] + y_150_mf6_sln = conc_mf6[-1, 6, (42 - 1), 22:] - y_10_mf6_sln = conc_mf6[0, 6, (42 - 1), 22:] - y_150_mf6_sln = conc_mf6[-1, 6, (42 - 1), 22:] + # Create figure for scenario + with styles.USGSPlot() as fs: + sim_name = sim_mf6gwt.name + plt.rcParams["lines.dashed_pattern"] = [5.0, 5.0] - # Create figure for scenario - with styles.USGSPlot() as fs: - sim_name = sim_mf6gwt.name - plt.rcParams["lines.dashed_pattern"] = [5.0, 5.0] + if ax is None: + fig = plt.figure(figsize=figure_size, dpi=300, tight_layout=True) + ax = fig.add_subplot(1, 1, 1) - if ax is None: - fig = plt.figure(figsize=figure_size, dpi=300, tight_layout=True) - ax = fig.add_subplot(1, 1, 1) + for xc in avlines: + ax.axvline(x=xc, color="k", linestyle=":", alpha=0.1) - for xc in avlines: - ax.axvline(x=xc, color="k", linestyle=":", alpha=0.1) + ss_ln = ax.plot( + x_pos, + y_ss_anly_sln, + "r-", + label="Steady state analytical solution", + ) + tr_ln = ax.plot( + x_pos, y_tr_anly_sln, "b-", label="Transient analytical solution" + ) - ss_ln = ax.plot( - x_pos, - y_ss_anly_sln, - "r-", - label="Steady state analytical solution", - ) - tr_ln = ax.plot( - x_pos, y_tr_anly_sln, "b-", label="Transient analytical solution" + if mt3d is not None: + mt_ss_ln = ax.plot( + x_pos, y_150_mt_sln, "r+", label="Steady state MT3DMS, TVD" ) + mt_tr_ln = ax.plot(x_pos, y_10_mt_sln, "b+", label="Transient MT3DMS") - if mt3d is not None: - mt_ss_ln = ax.plot( - x_pos, y_150_mt_sln, "r+", label="Steady state MT3DMS, TVD" - ) - mt_tr_ln = ax.plot(x_pos, y_10_mt_sln, "b+", label="Transient MT3DMS") - - mf6_ss_ln = ax.plot( - x_pos, y_150_mf6_sln, "rx", label="Steady-state MF6-GWT" - ) - mf6_tr_ln = ax.plot( - x_pos, - y_10_mf6_sln, - "bo", - markerfacecolor="none", - label="Transient MF6-GWT", + mf6_ss_ln = ax.plot( + x_pos, y_150_mf6_sln, "rx", label="Steady-state MF6-GWT" + ) + mf6_tr_ln = ax.plot( + x_pos, + y_10_mf6_sln, + "bo", + markerfacecolor="none", + label="Transient MF6-GWT", + ) + ax.set_xlim(1, 100) + ax.set_ylim(285.15 - 2.1, 285.15 + 0.5) + ax.set_xscale("log") + ax.set_xlabel("x-coordinate, in meters") + ax.set_ylabel("temperature, in Kelvins") + ax.legend() + plt.tight_layout() + + # save figure + if plotSave: + letter = chr(ord("@") + idx + 1) + fpth = os.path.join( + "..", + "figures", + "{}{}".format( + "ex-" + sim_name + "-" + letter, + ".png", + ), ) - ax.set_xlim(1, 100) - ax.set_ylim(285.15 - 2.1, 285.15 + 0.5) - ax.set_xscale("log") - ax.set_xlabel("x-coordinate, in meters") - ax.set_ylabel("temperature, in Kelvins") - ax.legend() - plt.tight_layout() - - # save figure - if plotSave: - letter = chr(ord("@") + idx + 1) - fpth = os.path.join( - "..", - "figures", - "{}{}".format( - "ex-" + sim_name + "-" + letter, - ".png", - ), - ) - fig.savefig(fpth) + fig.savefig(fpth) # ### Function that wraps all of the steps for each MT3DMS Example 10 Problem scenario diff --git a/scripts/ex-gwt-henry.py b/scripts/ex-gwt-henry.py index ae3124c9..c890b58d 100644 --- a/scripts/ex-gwt-henry.py +++ b/scripts/ex-gwt-henry.py @@ -16,7 +16,7 @@ import flopy import matplotlib.pyplot as plt from flopy.plot.styles import styles -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed mf6exe = "mf6" exe_name_mf = "mf2005" @@ -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" # Scenario parameters - make sure there is at least one blank line before next item @@ -233,9 +232,8 @@ def run_model(sim, silent=True): def plot_conc(sim, idx): - with styles.USGSMap() as fs: + with styles.USGSMap(): sim_name = list(parameters.keys())[idx] - sim_ws = os.path.join(ws, sim_name) gwf = sim.get_model("flow") gwt = sim.get_model("trans") @@ -263,8 +261,7 @@ def plot_conc(sim, idx): def plot_results(sim, idx): - if plotModel: - plot_conc(sim, idx) + plot_conc(sim, idx) # Function that wraps all of the steps for each scenario diff --git a/scripts/ex-gwt-keating.py b/scripts/ex-gwt-keating.py index 2298d88c..79486555 100644 --- a/scripts/ex-gwt-keating.py +++ b/scripts/ex-gwt-keating.py @@ -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 # Set figure properties specific to the @@ -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" # Model units @@ -309,10 +308,8 @@ def write_model(sims, silent=True): @timed def run_model(sims, silent=True): sim_mf6gwf, sim_mf6gwt, sim_mf2005, sim_mt3dms = sims - print("Running mf6gwf model...") success, buff = sim_mf6gwf.run_simulation(silent=silent) assert success, buff - print("Running mf6gwt model...") success, buff = sim_mf6gwt.run_simulation(silent=silent) assert success, buff @@ -321,13 +318,12 @@ def run_model(sims, silent=True): def plot_results(sims, idx): - if plotModel: - print("Plotting model results...") - plot_head_results(sims, idx) - plot_conc_results(sims, idx) - plot_cvt_results(sims, idx) - if plotSave and createGif: - make_animated_gif(sims, idx) + print("Plotting model results...") + plot_head_results(sims, idx) + plot_conc_results(sims, idx) + plot_cvt_results(sims, idx) + if plotSave and createGif: + make_animated_gif(sims, idx) def plot_head_results(sims, idx): @@ -335,7 +331,6 @@ def plot_head_results(sims, idx): sim_mf6gwf, _, _, _ = sims gwf = sim_mf6gwf.flow botm = gwf.dis.botm.array - # gwt = sim_mf6gwt.trans with styles.USGSMap() as fs: sim_ws = sim_mf6gwf.simulation_data.mfpath.get_sim_path() diff --git a/scripts/ex-gwt-moc3d-p01.py b/scripts/ex-gwt-moc3d-p01.py index 841c9c67..90dd0b8f 100644 --- a/scripts/ex-gwt-moc3d-p01.py +++ b/scripts/ex-gwt-moc3d-p01.py @@ -17,7 +17,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -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 - make sure there is at least one blank line before next item @@ -443,13 +442,8 @@ def run_model(sims, silent=True): def plot_results_ct( sims, idx, longitudinal_dispersivity, retardation_factor, decay_rate ): - if not plotModel: - return - - print("Plotting C versus t model results...") _, sim_mf6gwt = sims - - with styles.USGSPlot() as fs: + with styles.USGSPlot(): sim_ws = sim_mf6gwt.simulation_data.mfpath.get_sim_path() mf6gwt_ra = sim_mf6gwt.get_model("trans").obs.output.obs().data fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) @@ -514,13 +508,8 @@ def plot_results_ct( def plot_results_cd( sims, idx, longitudinal_dispersivity, retardation_factor, decay_rate ): - if plotModel: - return - - print("Plotting C versus x model results...") _, sim_mf6gwt = sims - - with styles.USGSPlot() as fs: + with styles.USGSPlot(): ucnobj_mf6 = sim_mf6gwt.trans.output.concentration() fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) diff --git a/scripts/ex-gwt-moc3d-p02.py b/scripts/ex-gwt-moc3d-p02.py index db166a23..012dd02a 100644 --- a/scripts/ex-gwt-moc3d-p02.py +++ b/scripts/ex-gwt-moc3d-p02.py @@ -17,7 +17,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 from scipy.special import erfc mf6exe = "mf6" @@ -36,9 +36,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 @@ -290,17 +289,10 @@ def plot_analytical(ax, levels): def plot_results(sims): - if plotModel: - return - - print("Plotting model results...") _, sim_mf6gwt = sims - - with styles.USGSMap() as fs: + with styles.USGSMap(): conc = sim_mf6gwt.trans.output.concentration().get_data() - fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) - gwt = sim_mf6gwt.trans pmv = flopy.plot.PlotMapView(model=gwt, ax=axs) levels = [1, 3, 10, 30, 100, 300] diff --git a/scripts/ex-gwt-moc3d-p02tg.py b/scripts/ex-gwt-moc3d-p02tg.py index 21699c77..53ef99a7 100644 --- a/scripts/ex-gwt-moc3d-p02tg.py +++ b/scripts/ex-gwt-moc3d-p02tg.py @@ -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 from scipy.special import erfc mf6exe = "mf6" @@ -37,9 +37,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 @@ -378,13 +377,8 @@ def plot_analytical(ax, levels): def plot_grid(sims): - if not plotModel: - return - - print("Plotting model results...") _, sim_mf6gwt = sims - - with styles.USGSMap() as fs: + with styles.USGSMap(): sim_ws = sim_mf6gwt.simulation_data.mfpath.get_sim_path() fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) gwt = sim_mf6gwt.trans @@ -404,13 +398,8 @@ def plot_grid(sims): def plot_results(sims): - if not plotModel: - return - - print("Plotting model results...") _, sim_mf6gwt = sims - - with styles.USGSMap() as fs: + with styles.USGSMap(): gwt = sim_mf6gwt.get_model("trans") conc = gwt.output.concentration().get_data() diff --git a/scripts/ex-gwt-mt3dms-p01.py b/scripts/ex-gwt-mt3dms-p01.py index 6261e2f7..76483f22 100644 --- a/scripts/ex-gwt-mt3dms-p01.py +++ b/scripts/ex-gwt-mt3dms-p01.py @@ -32,7 +32,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -45,9 +45,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" # Base simulation and model name and workspace @@ -522,11 +521,7 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mt3d, mf6, idx, ax=None): - if not plotModel: - return - mt3d_out_path = mt3d.model_ws - mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS concentration output diff --git a/scripts/ex-gwt-mt3dms-p02.py b/scripts/ex-gwt-mt3dms-p02.py index d1c69ca8..89cafe7f 100644 --- a/scripts/ex-gwt-mt3dms-p02.py +++ b/scripts/ex-gwt-mt3dms-p02.py @@ -17,7 +17,7 @@ import flopy import matplotlib.pyplot as plt from flopy.plot.styles import styles -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed mf6exe = "mf6" @@ -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" # Scenario parameters - make sure there is at least one blank line before next item @@ -401,13 +400,10 @@ def run_model(sims, silent=True): def plot_results_ct(sims, idx, **kwargs): - if not plotModel: - return - print("Plotting C versus t model results...") - sim_mf6gwf, sim_mf6gwt, sim_mf2005, sim_mt3dms = sims + _, sim_mf6gwt, _, sim_mt3dms = sims - with styles.USGSPlot() as fs: + with styles.USGSPlot(): sim_ws = sim_mf6gwt.simulation_data.mfpath.get_sim_path() mf6gwt_ra = sim_mf6gwt.get_model("trans").obs.output.obs().data fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) @@ -452,14 +448,8 @@ def plot_results_ct(sims, idx, **kwargs): def plot_results(): - if not plotModel: - return - - print("Plotting model results...") - - with styles.USGSPlot() as fs: + with styles.USGSPlot(): fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) - case_colors = ["blue", "green", "red", "yellow"] pkeys = list(parameters.keys()) for icase, sim_name in enumerate(pkeys[2:]): diff --git a/scripts/ex-gwt-mt3dms-p03.py b/scripts/ex-gwt-mt3dms-p03.py index 99826d62..3944324c 100644 --- a/scripts/ex-gwt-mt3dms-p03.py +++ b/scripts/ex-gwt-mt3dms-p03.py @@ -31,7 +31,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -49,9 +49,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 @@ -484,11 +483,7 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mt3d, mf6, idx, ax=None): - if not plotModel: - return - mt3d_out_path = mt3d.model_ws - mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS concentration output diff --git a/scripts/ex-gwt-mt3dms-p04.py b/scripts/ex-gwt-mt3dms-p04.py index 71566873..8c5b4c23 100644 --- a/scripts/ex-gwt-mt3dms-p04.py +++ b/scripts/ex-gwt-mt3dms-p04.py @@ -31,7 +31,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -44,9 +44,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" # Base simulation and model name and workspace @@ -510,11 +509,7 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mt3d, mf6, idx, leglab1, leglab2, ax=None): - if not plotModel: - return - mt3d_out_path = mt3d.model_ws - mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS concentration output diff --git a/scripts/ex-gwt-mt3dms-p05.py b/scripts/ex-gwt-mt3dms-p05.py index b6c4249e..dfed6b58 100644 --- a/scripts/ex-gwt-mt3dms-p05.py +++ b/scripts/ex-gwt-mt3dms-p05.py @@ -31,7 +31,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -44,9 +44,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" # Base simulation and model name and workspace @@ -486,11 +485,7 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mt3d, mf6, idx, ax=None, ax2=None): - if not plotModel: - return - mt3d_out_path = mt3d.model_ws - mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS concentration output diff --git a/scripts/ex-gwt-mt3dms-p06.py b/scripts/ex-gwt-mt3dms-p06.py index fcfa6437..cde62174 100644 --- a/scripts/ex-gwt-mt3dms-p06.py +++ b/scripts/ex-gwt-mt3dms-p06.py @@ -31,7 +31,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -44,9 +44,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" # Base simulation and model name and workspace @@ -488,26 +487,20 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mt3d, mf6, idx, ax=None): - if not plotModel: - return - mt3d_out_path = mt3d.model_ws mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS observation output file fname = os.path.join(mt3d_out_path, "MT3D001.OBS") - if os.path.isfile(fname): - cvt = mt3d.load_obs(fname) - else: - cvt = None + cvt = mt3d.load_obs(fname) if os.path.isfile(fname) else None # Get the MODFLOW 6 concentration observation output file fname = os.path.join(mf6_out_path, list(mf6.model_names)[1] + ".obs.csv") mf6cobs = flopy.utils.Mf6Obs(fname).data # Create figure for scenario - with styles.USGSPlot() as fs: + with styles.USGSPlot(): sim_name = mf6.name plt.rcParams["lines.dashed_pattern"] = [5.0, 5.0] if ax is None: diff --git a/scripts/ex-gwt-mt3dms-p07.py b/scripts/ex-gwt-mt3dms-p07.py index 8e5698ee..611fdd69 100644 --- a/scripts/ex-gwt-mt3dms-p07.py +++ b/scripts/ex-gwt-mt3dms-p07.py @@ -31,7 +31,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -44,9 +44,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" # Base simulation and model name and workspace @@ -486,11 +485,7 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mf2k5, mt3d, mf6, idx, ax=None): - if not plotModel: - return - mt3d_out_path = mt3d.model_ws - mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS concentration output diff --git a/scripts/ex-gwt-mt3dms-p08.py b/scripts/ex-gwt-mt3dms-p08.py index f45f5248..9aee8c7e 100644 --- a/scripts/ex-gwt-mt3dms-p08.py +++ b/scripts/ex-gwt-mt3dms-p08.py @@ -32,7 +32,7 @@ import numpy as np from flopy.plot.styles import styles from flopy.utils.util_array import read1d -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed mf6exe = "mf6" exe_name_mf = "mf2005" @@ -45,9 +45,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" # Base simulation and model name and workspace @@ -553,12 +552,7 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mf2k5, mt3d, mf6, idx, ax=None): - if not plotModel: - return - - print("Plotting model results...") mt3d_out_path = mt3d.model_ws - mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS concentration output diff --git a/scripts/ex-gwt-mt3dms-p09.py b/scripts/ex-gwt-mt3dms-p09.py index b1d13dfb..e38aa98e 100644 --- a/scripts/ex-gwt-mt3dms-p09.py +++ b/scripts/ex-gwt-mt3dms-p09.py @@ -31,7 +31,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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -44,9 +44,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" # Base simulation and model name and workspace @@ -507,12 +506,7 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mf2k5, mt3d, mf6, idx, ax=None): - if not plotModel: - return - - print("Plotting model results...") mt3d_out_path = mt3d.model_ws - mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() mf6.simulation_data.mfpath.get_sim_path() # Get the MT3DMS concentration output diff --git a/scripts/ex-gwt-mt3dms-p10.py b/scripts/ex-gwt-mt3dms-p10.py index 4e9f6870..3ceeb9e7 100644 --- a/scripts/ex-gwt-mt3dms-p10.py +++ b/scripts/ex-gwt-mt3dms-p10.py @@ -32,7 +32,7 @@ import numpy as np from flopy.plot.styles import styles from flopy.utils.util_array import read1d -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed mf6exe = "mf6" exe_name_mf = "mf2005" @@ -45,9 +45,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" # Base simulation and model name and workspace @@ -603,9 +602,6 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mf2k5, mt3d, mf6, idx, ax=None): - if not plotModel: - return - print("Plotting model results...") mt3d_out_path = mt3d.model_ws mf6_out_path = mf6.simulation_data.mfpath.get_sim_path() diff --git a/scripts/ex-gwt-mt3dsupp631.py b/scripts/ex-gwt-mt3dsupp631.py index dd5b0d63..25e84c2e 100644 --- a/scripts/ex-gwt-mt3dsupp631.py +++ b/scripts/ex-gwt-mt3dsupp631.py @@ -16,7 +16,7 @@ import flopy import matplotlib.pyplot as plt 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 @@ -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" # Model units @@ -273,12 +272,8 @@ def run_model(sims, silent=True): def plot_results(sims, idx): - if not plotModel: - return - - print("Plotting model results...") _, sim_mf6gwt, _, sim_mt3dms = sims - with styles.USGSPlot() as fs: + with styles.USGSPlot(): mf6gwt_ra = sim_mf6gwt.get_model("trans").obs.output.obs().data fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) axs.plot( diff --git a/scripts/ex-gwt-mt3dsupp632.py b/scripts/ex-gwt-mt3dsupp632.py index b90ae78b..e0540063 100644 --- a/scripts/ex-gwt-mt3dsupp632.py +++ b/scripts/ex-gwt-mt3dsupp632.py @@ -17,7 +17,7 @@ import flopy import matplotlib.pyplot as plt 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 @@ -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" # Scenario parameters - make sure there is at least one blank line before next item @@ -383,12 +382,7 @@ def run_model(sims, silent=True): def plot_results(): - if not plotModel: - return - - print("Plotting model results...") - - with styles.USGSPlot() as fs: + with styles.USGSPlot(): fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) case_colors = ["blue", "green", "red"] @@ -429,11 +423,8 @@ def plot_results(): def plot_scenario_results(sims, idx): - if not plotModel: - return - print("Plotting model results...") _, sim_mf6gwt, _, sim_mt3dms = sims - with styles.USGSPlot() as fs: + with styles.USGSPlot(): mf6gwt_ra = sim_mf6gwt.get_model("trans").obs.output.obs().data fig, axs = plt.subplots(1, 1, figsize=figure_size, dpi=300, tight_layout=True) axs.plot( diff --git a/scripts/ex-gwt-mt3dsupp82.py b/scripts/ex-gwt-mt3dsupp82.py index 5095d555..f2a99d39 100644 --- a/scripts/ex-gwt-mt3dsupp82.py +++ b/scripts/ex-gwt-mt3dsupp82.py @@ -17,7 +17,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 @@ -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 @@ -368,9 +367,6 @@ def run_model(sims, silent=True): def plot_results(sims, idx): - if not plotModel: - return - print("Plotting model results...") sim_mf6gwf, sim_mf6gwt, _, sim_mt3dms = sims gwf = sim_mf6gwf.flow diff --git a/scripts/ex-gwt-prudic2004t2.py b/scripts/ex-gwt-prudic2004t2.py index 3c40567f..d143798f 100644 --- a/scripts/ex-gwt-prudic2004t2.py +++ b/scripts/ex-gwt-prudic2004t2.py @@ -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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -37,9 +37,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 @@ -532,54 +531,51 @@ def plot_results(sims): def plot_gwf_results(sims): - if plotModel: - print("Plotting model results...") - sim_mf6gwf, sim_mf6gwt = sims - gwf = sim_mf6gwf.flow - with styles.USGSMap() as fs: - sim_ws = sim_mf6gwf.simulation_data.mfpath.get_sim_path() - - head = gwf.output.head().get_data() - stage = gwf.lak.output.stage().get_data().flatten() - - il, jl = np.where(lakibd > 0) - for i, j in zip(il, jl): - ilak = lakibd[i, j] - 1 - lake_stage = stage[ilak] - head[0, i, j] = lake_stage - - fig, axs = plt.subplots( - 1, 2, figsize=figure_size, dpi=300, tight_layout=True - ) + print("Plotting model results...") + sim_mf6gwf, _ = sims + gwf = sim_mf6gwf.flow + with styles.USGSMap(): + sim_ws = sim_mf6gwf.simulation_data.mfpath.get_sim_path() - for ilay in [0, 1]: - ax = axs[ilay] - pmv = plot_bcmap(ax, gwf, ilay) - levels = np.arange(20, 60, 1) - cs = pmv.contour_array( - head, - colors="blue", - linestyles="-", - levels=levels, - masked_values=[1.0e30], - ) - ax.clabel(cs, cs.levels[::5], fmt="%1.0f", colors="b") - title = f"Model Layer {ilay + 1}" - letter = chr(ord("@") + ilay + 1) - styles.heading(letter=letter, heading=title, ax=ax) + head = gwf.output.head().get_data() + stage = gwf.lak.output.stage().get_data().flatten() - # save figure - if plotSave: - sim_folder = os.path.split(sim_ws)[0] - sim_folder = os.path.basename(sim_folder) - fname = f"{sim_folder}-head.png" - fpth = os.path.join(ws, "..", "figures", fname) - fig.savefig(fpth) + il, jl = np.where(lakibd > 0) + for i, j in zip(il, jl): + ilak = lakibd[i, j] - 1 + lake_stage = stage[ilak] + head[0, i, j] = lake_stage + + fig, axs = plt.subplots( + 1, 2, figsize=figure_size, dpi=300, tight_layout=True + ) + + for ilay in [0, 1]: + ax = axs[ilay] + pmv = plot_bcmap(ax, gwf, ilay) + levels = np.arange(20, 60, 1) + cs = pmv.contour_array( + head, + colors="blue", + linestyles="-", + levels=levels, + masked_values=[1.0e30], + ) + ax.clabel(cs, cs.levels[::5], fmt="%1.0f", colors="b") + title = f"Model Layer {ilay + 1}" + letter = chr(ord("@") + ilay + 1) + styles.heading(letter=letter, heading=title, ax=ax) + + # save figure + if plotSave: + sim_folder = os.path.split(sim_ws)[0] + sim_folder = os.path.basename(sim_folder) + fname = f"{sim_folder}-head.png" + fpth = os.path.join(ws, "..", "figures", fname) + fig.savefig(fpth) def plot_gwt_results(sims): - if not plotModel: - return print("Plotting model results...") sim_mf6gwf, sim_mf6gwt = sims gwf = sim_mf6gwf.flow diff --git a/scripts/ex-gwt-rotate.py b/scripts/ex-gwt-rotate.py index 82608ae1..876ef4c4 100644 --- a/scripts/ex-gwt-rotate.py +++ b/scripts/ex-gwt-rotate.py @@ -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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -36,9 +36,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 @@ -483,11 +482,10 @@ def update(i): def plot_results(sim, idx): - if plotModel: - plot_conc(sim, idx) - plot_velocity_profile(sim, idx) - if plotSave and createGif: - make_animated_gif(sim, idx) + plot_conc(sim, idx) + plot_velocity_profile(sim, idx) + if plotSave and createGif: + make_animated_gif(sim, idx) # Function that wraps all of the steps for each scenario diff --git a/scripts/ex-gwt-saltlake.py b/scripts/ex-gwt-saltlake.py index c53e9058..ed716ddf 100644 --- a/scripts/ex-gwt-saltlake.py +++ b/scripts/ex-gwt-saltlake.py @@ -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 mf6exe = "mf6" exe_name_mf = "mf2005" @@ -36,9 +36,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 @@ -341,10 +340,9 @@ def update(i): def plot_results(sim, idx): - if plotModel: - plot_conc(sim, idx) - if plotSave and createGif: - make_animated_gif(sim, idx) + plot_conc(sim, idx) + if plotSave and createGif: + make_animated_gif(sim, idx) # Function that wraps all of the steps for each scenario diff --git a/scripts/ex-gwt-stallman.py b/scripts/ex-gwt-stallman.py index 131638f8..6da1d006 100644 --- a/scripts/ex-gwt-stallman.py +++ b/scripts/ex-gwt-stallman.py @@ -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 mf6exe = "mf6" @@ -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 @@ -395,12 +394,9 @@ def update(j): def plot_results(sim, idx): - print("Plotting results...") - if plotModel: - plot_conc(sim, idx) - if plotSave and createGif: - print("Making animation...") - make_animated_gif(sim, idx) + plot_conc(sim, idx) + if plotSave and createGif: + make_animated_gif(sim, idx) # Function that wraps all of the steps for each scenario diff --git a/scripts/ex-gwt-synthetic-valley.py b/scripts/ex-gwt-synthetic-valley.py index 748e7ab6..e30e7b1d 100644 --- a/scripts/ex-gwt-synthetic-valley.py +++ b/scripts/ex-gwt-synthetic-valley.py @@ -24,15 +24,14 @@ from flopy.utils.triangle import Triangle from flopy.utils.voronoi import VoronoiGrid from matplotlib import colors -from modflow_devtools.misc import is_in_ci, timed +from modflow_devtools.misc import timed from shapely.geometry import LineString, Polygon # 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" # Groundwater 2023 utilities @@ -810,8 +809,6 @@ def plot_feature_labels(ax): def plot_results(sims, idx): - if not plotModel: - return print("Plotting model results...") plot_river_mapping(sims, idx) plot_head_results(sims, idx) diff --git a/scripts/ex-gwt-uzt-2d.py b/scripts/ex-gwt-uzt-2d.py index 82c85b36..4ace35cc 100644 --- a/scripts/ex-gwt-uzt-2d.py +++ b/scripts/ex-gwt-uzt-2d.py @@ -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 mf6exe = "mf6" exe_name_mf = "mfnwt" @@ -32,9 +32,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 scenario parameters (make sure there is at least one blank line before next item) # This entire dictionary is passed to _build_model()_ using the kwargs argument @@ -788,9 +787,6 @@ def run_model(mf2k5, mt3d, sim, silent=True): def plot_results(mf2k5, mt3d, mf6, idx, ax=None): - if not plotModel: - return - print("Plotting model results...") mt3d_out_path = mt3d.model_ws mf6_out_path = mf6.simulation_data.mfpath.get_sim_path()