Skip to content

Commit

Permalink
fix(subpackages): fixed detection issue of subpackages in some filein…
Browse files Browse the repository at this point in the history
… records (#2025)
  • Loading branch information
scottrp authored Dec 4, 2023
1 parent 5110975 commit 788a8df
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
32 changes: 32 additions & 0 deletions autotest/test_mf6.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
ModflowNam,
ModflowTdis,
ModflowUtllaktab,
ModflowUtlspca,
)
from flopy.mf6.coordinates.modeldimensions import (
DataDimensions,
Expand Down Expand Up @@ -2230,6 +2231,37 @@ def test_multi_model(function_tmpdir):
assert fi_out[1][2] is None
assert fi_out[2][2] == "MIXED"

spca1 = ModflowUtlspca(
gwt2,
filename="gwt_model_1.rch1.spc",
print_input=True
)
spca2 = ModflowUtlspca(
gwt2,
filename="gwt_model_1.rch2.spc",
print_input=False
)
spca3 = ModflowUtlspca(
gwt2,
filename="gwt_model_1.rch3.spc",
print_input=True
)
spca4 = ModflowUtlspca(
gwt2,
filename="gwt_model_1.rch4.spc",
print_input=True
)

# test writing and loading spca packages
sim2.write_simulation()
sim3 = MFSimulation.load(sim_ws=sim2.sim_path)
gwt3 = sim3.get_model("gwt_model_1")
spc1 = gwt3.get_package("gwt_model_1.rch1.spc")
assert isinstance(spc1, ModflowUtlspca)
assert spc1.print_input.get_data() is True
spc2 = gwt3.get_package("gwt_model_1.rch2.spc")
assert spc2.print_input.get_data() is not True

# create a new gwt model
sourcerecarray = [("WEL-1", "AUX", "CONCENTRATION")]
gwt_2 = get_gwt_model(
Expand Down
1 change: 0 additions & 1 deletion flopy/mf6/mfpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,6 @@ def _get_package_info(self, dataset):
)

return package_info_list
return None
return None

def _add_to_info_list(
Expand Down

0 comments on commit 788a8df

Please sign in to comment.