Skip to content

Commit

Permalink
Need update initial autotest to conform to new autotest standards ado…
Browse files Browse the repository at this point in the history
…pted with MODFLOW-USGS#1464
  • Loading branch information
emorway-usgs committed Feb 6, 2024
1 parent fe1a7a7 commit 17878b3
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions autotest/test_gwe_dsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# Imports

import os
import sys

import numpy as np
import pytest

Expand All @@ -35,7 +33,6 @@


from framework import TestFramework
from simulation import TestSimulation

# Base simulation and model name and workspace

Expand Down Expand Up @@ -124,9 +121,9 @@
ctpspd = [[(0, 0, 0), c0]]


def build_model(idx, dir):
def build_models(idx, test):
# Base MF6 GWE model type
ws = dir
ws = test.workspace
name = ex[idx]

print("Building MF6 model...()".format(name))
Expand Down Expand Up @@ -357,14 +354,14 @@ def build_model(idx, dir):
return sim, None


def eval_transport(sim):
def check_output(idx, test):
print("evaluating results...")

# read transport results from GWE model
name = ex[sim.idxsim]
name = ex[idx]
gwename = "gwe-" + name

fpth = os.path.join(sim.simpath, f"{gwename}.ucn")
fpth = os.path.join(test.workspace, f"{gwename}.ucn")
try:
# load temperatures
cobj = flopy.utils.HeadFile(
Expand Down Expand Up @@ -489,12 +486,11 @@ def eval_transport(sim):
list(enumerate(ex)),
)
def test_mf6model(idx, name, function_tmpdir, targets):
ws = str(function_tmpdir)
test = TestFramework()
test.build(build_model, idx, ws)
test.run(
TestSimulation(
name=name, exe_dict=targets, exfunc=eval_transport, idxsim=idx
),
ws,
test = TestFramework(
name=name,
workspace=function_tmpdir,
build=lambda t: build_models(idx, t),
check=lambda t: check_output(idx, t),
targets=targets,
)
test.run()

0 comments on commit 17878b3

Please sign in to comment.