diff --git a/autotest/t013_test.py b/autotest/t013_test.py index d3528ce959..5328fedbc2 100644 --- a/autotest/t013_test.py +++ b/autotest/t013_test.py @@ -78,6 +78,24 @@ def test_mt3d_create_woutmfmodel(): return +def test_mt3d_pht3d(): + # Note: this test is incomplete! + model_ws = os.path.join('.', 'temp', 't013') + + # Create MT3D model + mt = flopy.mt3d.Mt3dms(model_ws=model_ws) + phc = flopy.mt3d.Mt3dPhc(mt, minkin=[[[1]], [[2]]]) + + # Write the output + mt.write_input() + + # confirm that MT3D files exist + assert os.path.isfile( + os.path.join(model_ws, '{}.{}'.format(mt.name, phc.extension[0]))) + + return + + if __name__ == '__main__': test_mt3d_create_withmfmodel() test_mt3d_create_woutmfmodel() diff --git a/autotest/t022_test.py b/autotest/t022_test.py index 177abbde62..9ebcdb1c82 100644 --- a/autotest/t022_test.py +++ b/autotest/t022_test.py @@ -376,19 +376,18 @@ def test_swr_binary_obs(ipos=5): for idx in range(ntimes): df = sobj.get_dataframe(idx=idx, timeunit='S') assert isinstance(df, pd.DataFrame), 'A DataFrame was not returned' - assert df.shape == (1, nobs+1), 'data shape is not (1, 9)' + assert df.shape == (1, nobs + 1), 'data shape is not (1, 10)' for time in times: df = sobj.get_dataframe(totim=time, timeunit='S') assert isinstance(df, pd.DataFrame), 'A DataFrame was not returned' - assert df.shape == (1, 9), 'data shape is not (1, 9)' + assert df.shape == (1, nobs + 1), 'data shape is not (1, 10)' - df = h.get_dataframe(timeunit='D') + df = sobj.get_dataframe(timeunit='S') assert isinstance(df, pd.DataFrame), 'A DataFrame was not returned' - assert df.shape == (101, 9), 'data shape is not (101, 9)' - except: + assert df.shape == (336, nobs + 1), 'data shape is not (336, 10)' + except ImportError: print('pandas not available...') - pass return diff --git a/flopy/mf6/utils/generate_classes.py b/flopy/mf6/utils/generate_classes.py index d2f9dd7f8e..753cce763f 100644 --- a/flopy/mf6/utils/generate_classes.py +++ b/flopy/mf6/utils/generate_classes.py @@ -79,7 +79,7 @@ def backup_existing_dfns(flopy_dfn_path): backup_folder = os.path.join(parent_folder, 'dfn_backup', timestr) shutil.copytree(flopy_dfn_path, backup_folder) assert os.path.isdir(backup_folder), \ - 'dfn backup files not found: {}'.format(pth) + 'dfn backup files not found: {}'.format(backup_folder) return diff --git a/flopy/modflow/mfde4.py b/flopy/modflow/mfde4.py index 11dc4779da..f8c5412c62 100644 --- a/flopy/modflow/mfde4.py +++ b/flopy/modflow/mfde4.py @@ -271,7 +271,7 @@ def load(f, model, ext_unit_dict=None): itmx = int(line[0:10].strip()) mxup = int(line[10:20].strip()) mxlow = int(line[20:30].strip()) - mxbw = int(tline[30:40].strip()) + mxbw = int(line[30:40].strip()) line = f.readline() ifreq = int(line[0:10].strip()) mutd4 = int(line[10:20].strip()) diff --git a/flopy/modflow/mfsms.py b/flopy/modflow/mfsms.py index a8f75e69ab..0520b56b53 100644 --- a/flopy/modflow/mfsms.py +++ b/flopy/modflow/mfsms.py @@ -392,9 +392,10 @@ def load(f, model, ext_unit_dict=None): # Record 1a nopt = 0 opts = ['simple', 'moderate', 'complex'] + options = [] for o in opts: if o in line.lower(): - options.append(0) + options.append(o) nopt += 1 if nopt > 0: @@ -546,7 +547,7 @@ def load(f, model, ext_unit_dict=None): iacl=iacl, norder=norder, level=level, north=north, iredsys=iredsys, rrctol=rrctol, idroptol=idroptol, epsrn=epsrn, clin=clin, ipc=ipc, iscl=iscl, - iord=iord, rclosepcgu=rclosepcgu, + iord=iord, rclosepcgu=rclosepcgu, options=options, relaxpcgu=relaxpcgu, unitnumber=unitnumber, filenames=filenames) return sms diff --git a/flopy/modflow/mfstr.py b/flopy/modflow/mfstr.py index fb9953912a..555352973b 100644 --- a/flopy/modflow/mfstr.py +++ b/flopy/modflow/mfstr.py @@ -12,6 +12,7 @@ import numpy as np from ..utils import MfList from ..pakbase import Package +from .mfparbc import ModflowParBc as mfparbc from ..utils.recarray_utils import create_empty_recarray @@ -290,9 +291,9 @@ def __init__(self, model, mxacts=0, nss=0, ntrib=0, ndiv=0, icalc=0, self.dtype = dtype[0] self.dtype2 = dtype[1] else: - auxnames = [] + aux_names = [] if len(options) > 0: - auxnames = [] + aux_names = [] it = 0 while True: if 'aux' in options[it].lower(): @@ -301,9 +302,9 @@ def __init__(self, model, mxacts=0, nss=0, ntrib=0, ndiv=0, icalc=0, it += 1 if it > len(options): break - if len(auxnames) < 1: - auxnames = None - d, d2 = self.get_empty(1, 1, aux_names=auxnames, + if len(aux_names) < 1: + aux_names = None + d, d2 = self.get_empty(1, 1, aux_names=aux_names, structured=self.parent.structured) self.dtype = d.dtype self.dtype2 = d2.dtype diff --git a/flopy/mt3d/mtphc.py b/flopy/mt3d/mtphc.py index dd0669b1d1..9a514ea7b1 100644 --- a/flopy/mt3d/mtphc.py +++ b/flopy/mt3d/mtphc.py @@ -10,7 +10,7 @@ class Mt3dPhc(Package): def __init__(self, model, os=2, temp=25, asbin=0, eps_aqu=0, eps_ph=0, scr_output=1, cb_offset=0, smse=['pH', 'pe'], mine=[], ie=[], surf=[], mobkin=[], minkin=[], surfkin=[], imobkin=[], - extension='phc', unitnumber=None): + extension='phc', unitnumber=None, filenames=None): if unitnumber is None: unitnumber = Mt3dPhc.defaultunit() diff --git a/flopy/utils/mflistfile.py b/flopy/utils/mflistfile.py index 105604a2c7..02c397ff24 100644 --- a/flopy/utils/mflistfile.py +++ b/flopy/utils/mflistfile.py @@ -812,7 +812,7 @@ def _get_sp(self, ts, sp, seekpoint): if len(re.findall('=', line)) == 2: try: entry, flux, cumu = self._parse_budget_line(line) - except e: + except Exception: print('error parsing budget line in ts,sp', ts, sp) return self.null_entries if flux is None: