fix(mnw2): fix issues causing random failures on python 3.5 (#739)

develop
Hughes, J.D 2019-11-22 21:14:43 -06:00 committed by GitHub
parent c03821d6c9
commit 8c118ec4b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -157,11 +157,10 @@ def test_make_package():
m4.write_input()
# make the package from the objects
# reuse second per pumping for last stress period
mnw2fromobj = flopy.modflow.ModflowMnw2(model=m4, mnwmax=2,
mnw=mnw2_4.mnw,
itmp=[2, 2, -1],
# reuse second per pumping for last stress period
)
itmp=[2, 2, -1])
# verify that the two input methods produce the same results
assert np.array_equal(mnw2_4.stress_period_data[1],
mnw2fromobj.stress_period_data[1])
@ -318,8 +317,9 @@ mnw2 103 mymnw2.mnw2"""
wellids = ['eb-33', 'eb-35', 'eb-36']
rates = [np.float32(-11229.2), np.float32(-534.72), np.float32(-534.72)]
wellids2 = sorted(list(mnw2.mnw.keys()))
emsg = 'incorrect keys returned from load mnw2'
assert list(mnw2.mnw.keys()) == wellids, emsg
assert wellids2 == wellids, emsg
spd = mnw2.stress_period_data[0]

View File

@ -1455,7 +1455,8 @@ class ModflowMnw2(Package):
node_data = ModflowMnw2.get_empty_node_data(len(mnwobj_node_data))
for ix, node in enumerate(mnwobj_node_data):
node_data[ix] = node
for jx, name in enumerate(node_data.dtype.names):
node_data[name][ix] = node[jx]
self.node_data = node_data