Skip to content

Commit

Permalink
tests(t004): fix small issue that only occurs on Windows (#695)
Browse files Browse the repository at this point in the history
t004 fails on Windows in comparing a data frame to a numpy array.  The i, j, k columns from the data frame were upgraded to long ints.  Apparently the default int on Windows is different from the default on mac/linux, so test failures don't show up there.

Also stop versioning several shapefiles that are recreated with every test run.
  • Loading branch information
langevin-usgs authored Oct 24, 2019
1 parent 2d76758 commit cb02669
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions autotest/t004_test_utilarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,10 @@ def test_mflist():
fluxcol = 'flux{}'.format(per)
dfper = df.dropna(subset=[fluxcol], axis=0).copy()
dfper.rename(columns={fluxcol: 'flux'}, inplace=True)
assert np.array_equal(dfper[['k', 'i', 'j', 'flux']].to_records(index=False), data)
dfdata = dfper[['k', 'i', 'j', 'flux']].to_records(index=False)
dfdata = dfdata.astype(data.dtype)
errmsg = 'data not equal:\n {}\n {}'.format(dfdata, data)
assert np.array_equal(dfdata, data), errmsg

m4ds = ml.wel.stress_period_data.masked_4D_arrays
sp_data = flopy.utils.MfList.masked4D_arrays_to_stress_period_data \
Expand Down Expand Up @@ -792,7 +795,7 @@ def test_util3d_reset():
# test_util2d_external_fixed_nomodelws()
# test_util2d_external_fixed_path_nomodelws()
# test_transient2d()
#test_transient3d()
# test_transient3d()
# test_util2d()
# test_util3d()
# test_how()
Binary file modified examples/data/mf6/test003_gwfs_disv/test003_gwfs_disv.dbf
Binary file not shown.
Binary file modified examples/data/mf6/test003_gwfs_disv/test003_gwfs_disv.shp
Binary file not shown.
Binary file modified examples/data/mf6/test003_gwfs_disv/test003_gwfs_disv.shx
Binary file not shown.
1 change: 0 additions & 1 deletion flopy/utils/util_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ def get_dataframe(self, squeeze=True):
dfi = dfi.set_index(names)
else:
dfi = pd.DataFrame.from_records(recs)
# dfi = dfi.set_index(names)
dfg = dfi.groupby(names)
count = dfg[varnames[0]].count().rename('n')
if (count > 1).values.any():
Expand Down

0 comments on commit cb02669

Please sign in to comment.