Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(pakbase): specify dtype=bool for 0-d active array used for USG #1188

Merged
merged 1 commit into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions autotest/t016_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,30 @@ def test_usg_rch_evt_models02a():
success, buff = m.run_model()
assert success

def test_usg_ss_to_tr():
# Test switching steady model to transient
# https://github.com/modflowpy/flopy/issues/1187
model_ws = os.path.join(
"..", "examples", "data", "mfusg_test", "01A_nestedgrid_nognc"
)
nam = "flow.nam"
m = flopy.modflow.Modflow.load(
nam, model_ws=model_ws, version="mfusg", exe_name=v
)
m.model_ws = tpth
m.disu.steady = [False]
m.write_input()
if run:
success, buff = m.run_model()
assert success

m = flopy.modflow.Modflow.load(
nam, model_ws=tpth, version="mfusg", exe_name=v
)
if run:
success, buff = m.run_model()
assert success


if __name__ == "__main__":
test_usg_disu_load()
Expand All @@ -266,3 +290,4 @@ def test_usg_rch_evt_models02a():
test_usg_rch_evt_models01()
test_usg_rch_evt_models02()
test_usg_rch_evt_models02a()
test_usg_ss_to_tr()
2 changes: 1 addition & 1 deletion flopy/pakbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def _check_storage(self, chk, storage_coeff):
[sarrays["sy"][sl] for sl in node_k_slices]
).flatten()
active = np.asarray(
[active[sl] for sl in node_k_slices]
[active[sl] for sl in node_k_slices], dtype=bool
).flatten()
else:
sarrays["sy"] = sarrays["sy"][inds, :, :]
Expand Down