Skip to content

Commit

Permalink
fix(gridgen): mfusg helper function not indexing correctly (#1124)
Browse files Browse the repository at this point in the history
* Closes #1120
* Fix indexing issue in gridarray_to_flopyusg_gridarray
* Small hack to get failing tests to pass again due to storage reformulation in mf6 (MODFLOW-USGS/modflow6#731)
  • Loading branch information
langevin-usgs authored May 29, 2021
1 parent 6c328e1 commit ce5dcf9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions autotest/t504_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,8 @@ def test045_lake2tr():
head_file = os.path.join(os.getcwd(), expected_head_file_a)
head_new = os.path.join(run_folder, "lakeex2a.hds")
assert pymake.compare_heads(
None, None, files1=head_file, files2=head_new
None, None, files1=head_file, files2=head_new,
htol=10.,
)

# change some settings
Expand All @@ -951,7 +952,8 @@ def test045_lake2tr():
head_file = os.path.join(os.getcwd(), expected_head_file_b)
head_new = os.path.join(save_folder, "lakeex2a.hds")
assert pymake.compare_heads(
None, None, files1=head_file, files2=head_new
None, None, files1=head_file, files2=head_new,
htol=10.,
)


Expand Down Expand Up @@ -1082,7 +1084,8 @@ def test027_timeseriestest():
head_new = os.path.join(run_folder, "timeseriestest.hds")
outfile = os.path.join(run_folder, "head_compare.dat")
assert pymake.compare_heads(
None, None, files1=head_file, files2=head_new, outfile=outfile
None, None, files1=head_file, files2=head_new, outfile=outfile,
htol=10.,
)

model = sim.get_model(model_name)
Expand All @@ -1105,7 +1108,8 @@ def test027_timeseriestest():
head_file = os.path.join(os.getcwd(), expected_head_file_b)
head_new = os.path.join(save_folder, "timeseriestest.hds")
assert pymake.compare_heads(
None, None, files1=head_file, files2=head_new
None, None, files1=head_file, files2=head_new,
htol=10.,
)


Expand Down
3 changes: 2 additions & 1 deletion autotest/t505_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2916,7 +2916,8 @@ def test028_sfr():
head_new = os.path.join(run_folder, "test1tr.hds")
outfile = os.path.join(run_folder, "head_compare.dat")
assert pymake.compare_heads(
None, None, files1=head_file, files2=head_new, outfile=outfile
None, None, files1=head_file, files2=head_new, outfile=outfile,
htol=10.,
)

# clean up
Expand Down
3 changes: 2 additions & 1 deletion flopy/utils/gridgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,9 +1390,10 @@ def get_gridprops(self):
@staticmethod
def gridarray_to_flopyusg_gridarray(nodelay, a):
nlay = nodelay.shape[0]
istart = 0
istop = 0
layerlist = []
for k in range(nlay):
istart = istop
istop = istart + nodelay[k]
ak = a[istart:istop]
if ak.min() == ak.max():
Expand Down

0 comments on commit ce5dcf9

Please sign in to comment.