diff --git a/autotest/test_gwe_drycell_conduction0.py b/autotest/test_gwe_drycell_conduction0.py index 059b8ea4bb7..849f1a81ab5 100644 --- a/autotest/test_gwe_drycell_conduction0.py +++ b/autotest/test_gwe_drycell_conduction0.py @@ -33,10 +33,7 @@ scheme = "UPSTREAM" # scheme = "TVD" -ex = ["drycell0"] -exdirs = [] -for s in ex: - exdirs.append(os.path.join("temp", s)) +cases = ["drycell0"] # Model units length_units = "meters" @@ -116,7 +113,7 @@ def build_models(idx, test): # Base MF6 GWF model type ws = test.workspace - name = ex[idx] + name = cases[idx] print("Building MF6 model...()".format(name)) @@ -345,7 +342,7 @@ def check_output(idx, test): print("evaluating results...") # read transport results from GWE model - name = ex[idx] + name = cases[idx] gwename = "gwe-" + name fpth = os.path.join(test.workspace, f"{gwename}.ucn") @@ -411,7 +408,7 @@ def check_output(idx, test): # - No need to change any code below @pytest.mark.parametrize( "idx, name", - list(enumerate(ex)), + list(enumerate(cases)), ) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwe_drycell_conduction1.py b/autotest/test_gwe_drycell_conduction1.py index 2f53fa0b7bf..25f154790b8 100644 --- a/autotest/test_gwe_drycell_conduction1.py +++ b/autotest/test_gwe_drycell_conduction1.py @@ -39,6 +39,7 @@ from framework import TestFramework + # Monotonicity function def isMonotonic(A): x, y = [], [] @@ -56,7 +57,7 @@ def isMonotonic(A): scheme = "UPSTREAM" # scheme = "TVD" -ex = [ +cases = [ "drycell2-a", # 2-cell model, horizontally connected with tops and bots aligned "drycell2-b", # 2-cell model, vertically connected "drycell2-c", # 2-cell model, horizontally connected with staggered alignment (reduced shared cell face area) @@ -151,7 +152,7 @@ def build_models(idx, test): # Base MF6 GWF model type ws = test.workspace - name = ex[idx] + name = cases[idx] print("Building MF6 model...()".format(name)) @@ -397,7 +398,7 @@ def check_output(idx, test): print("evaluating results...") # read transport results from GWE model - name = ex[idx] + name = cases[idx] gwename = "gwe-" + name # All indices are 0 based @@ -468,7 +469,7 @@ def check_output(idx, test): # - No need to change any code below @pytest.mark.parametrize( "idx, name", - list(enumerate(ex)), + list(enumerate(cases)), ) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( @@ -476,6 +477,6 @@ def test_mf6model(idx, name, function_tmpdir, targets): workspace=function_tmpdir, targets=targets, build=lambda t: build_models(idx, t), - check=lambda t: check_output(idx, t) + check=lambda t: check_output(idx, t), ) test.run() diff --git a/autotest/test_gwe_drycell_conduction2.py b/autotest/test_gwe_drycell_conduction2.py index 34f9ed2e996..d5e354b6f7a 100644 --- a/autotest/test_gwe_drycell_conduction2.py +++ b/autotest/test_gwe_drycell_conduction2.py @@ -53,6 +53,7 @@ # Base simulation and model name and workspace + def my_ceil(a, precision=0): return np.round(a + 0.5 * 10 ** (-precision), precision) @@ -76,10 +77,7 @@ def isMonotonic(A): scheme = "UPSTREAM" # scheme = "TVD" -ex = ["drycl-cnduct"] -exdirs = [] -for s in ex: - exdirs.append(os.path.join("temp", s)) +cases = ["drycl-cnduct"] # Model units length_units = "meters" @@ -192,7 +190,7 @@ def isMonotonic(A): def build_models(idx, test): # Base MF6 GWF model type ws = test.workspace - name = ex[idx] + name = cases[idx] print("Building MF6 model...()".format(name)) @@ -537,7 +535,7 @@ def check_output(idx, test): print("evaluating results...") # read transport results from GWE model - name = ex[idx] + name = cases[idx] gwfname = "gwf-" + name gwtname = "gwt-" + name gwename = "gwe-" + name @@ -618,10 +616,10 @@ def check_output(idx, test): assert np.all( np.diff(temp1[-1, :, 0, :-1]) < 0 ), "Temperature change in the downstream direction should be negative" - assert isMonotonic( - np.diff(temp1[-1, :, 0, :-1]) - ), "A monotonic increase in the amount of heat lost to neighboring dry " \ - "cells is expected" + assert isMonotonic(np.diff(temp1[-1, :, 0, :-1])), ( + "A monotonic increase in the amount of heat lost to neighboring dry " + "cells is expected" + ) # Check temporal changes in temperature in the most upstream and downstream # dry cells. Cell bottoms in row 2 were calculated using a rounding function @@ -631,32 +629,34 @@ def check_output(idx, test): # also conduction among its two dry neighbors (also with variable thickness colid = 0 m_arr = np.diff(temp1[1:, 0, 1, colid]) - assert isMonotonic( - m_arr - ), "Temperatures should be monotonically tapering-off in their " \ - "relative temperature increase with time in the upstream-most" \ - "dry cell" + assert isMonotonic(m_arr), ( + "Temperatures should be monotonically tapering-off in their " + "relative temperature increase with time in the upstream-most" + "dry cell" + ) colid = 11 m_arr = np.diff(temp1[1:, 0, 1, colid]) - assert isMonotonic( - m_arr - ), "Temperatures should be monotonically tapering-off in their " \ - "relative temperature increase with time in the downstream-most" \ - "dry cell" + assert isMonotonic(m_arr), ( + "Temperatures should be monotonically tapering-off in their " + "relative temperature increase with time in the downstream-most" + "dry cell" + ) # Run a few checks between GWE and its GWT counterpart # In GWT there is no solute interaction with a dry cell, so concentrations # in the dry cell should remain inactive (i.e., no "molecular diffusion") # and greater than their GWE counterpart temperatures since there is # no "retardation" of concentration (temperature) owing to conduction - assert np.all(conc1[:, :, 1, :] < 0), "The dry cells should never have a non-inactive concentration value" + assert np.all( + conc1[:, :, 1, :] < 0 + ), "The dry cells should never have a non-inactive concentration value" # - No need to change any code below @pytest.mark.parametrize( "idx, name", - list(enumerate(ex)), + list(enumerate(cases)), ) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwe_dsp.py b/autotest/test_gwe_dsp.py index 4f3407d8e04..0af08ee25ed 100644 --- a/autotest/test_gwe_dsp.py +++ b/autotest/test_gwe_dsp.py @@ -37,10 +37,7 @@ # Base simulation and model name and workspace viscosity_on = [False] -ex = ["dsp01"] -exdirs = [] -for s in ex: - exdirs.append(os.path.join("temp", s)) +cases = ["dsp01"] # Model units @@ -124,7 +121,7 @@ def build_models(idx, test): # Base MF6 GWE model type ws = test.workspace - name = ex[idx] + name = cases[idx] print("Building MF6 model...()".format(name)) @@ -358,7 +355,7 @@ def check_output(idx, test): print("evaluating results...") # read transport results from GWE model - name = ex[idx] + name = cases[idx] gwename = "gwe-" + name fpth = os.path.join(test.workspace, f"{gwename}.ucn") @@ -483,7 +480,7 @@ def check_output(idx, test): # - No need to change any code below @pytest.mark.parametrize( "idx, name", - list(enumerate(ex)), + list(enumerate(cases)), ) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework(