From 8bb71419ca07451cd1e8300d9c6c987dc2dd92f8 Mon Sep 17 00:00:00 2001 From: Christian Langevin Date: Mon, 22 Jul 2019 16:47:42 -0500 Subject: [PATCH 1/2] fix(run_model): trying to fix "cannot allocate memory" error --- flopy/mbase.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flopy/mbase.py b/flopy/mbase.py index 05ff34b295..612728dc0a 100644 --- a/flopy/mbase.py +++ b/flopy/mbase.py @@ -1473,7 +1473,7 @@ def to_shapefile(self, filename, package_names=None, **kwargs): def run_model(exe_name, namefile, model_ws='./', silent=False, pause=False, report=False, - normal_msg='normal termination', use_async=False, + normal_msg='normal termination', use_async=True, cargs=None): """ This function will run the model using subprocess.Popen. It @@ -1629,10 +1629,11 @@ def q_output(output, q): proc.stdout.close() for line in buff: - if normal_msg in line: - print("success") - success = True - break + for msg in normal_msg: + if msg in line.lower(): + print("success") + success = True + break if pause: input('Press Enter to continue...') From 9c1b82421c163c71058e56edf3671317cbde8b55 Mon Sep 17 00:00:00 2001 From: Christian Langevin Date: Wed, 24 Jul 2019 12:33:30 -0500 Subject: [PATCH 2/2] fix(autotest): move some output files to their own folder --- autotest/t032_test.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/autotest/t032_test.py b/autotest/t032_test.py index bbb0dde8e0..3f4c5fe73f 100644 --- a/autotest/t032_test.py +++ b/autotest/t032_test.py @@ -27,11 +27,15 @@ def test_polygon_from_ij(): nlay=2, delr=100, delc=100, top=3, botm=botm, model=m) - ncdf = NetCdf('toy.model.nc', m) + fname = os.path.join(mpth, 'toy.model.nc') + ncdf = NetCdf(fname, m) ncdf.write() - m.export('toy_model_two.nc') - dis.export('toy_model_dis.nc') + fname = os.path.join(mpth, 'toy_model_two.nc') + m.export(fname) + + fname = os.path.join(mpth, 'toy_model_dis.nc') + dis.export(fname) mg = m.modelgrid mg.set_coord_info(xoff=mg._xul_to_xll(600000.0, -45.0),