diff --git a/autotest/test_mf6.py b/autotest/test_mf6.py index 487a98a526..5e848a2f68 100644 --- a/autotest/test_mf6.py +++ b/autotest/test_mf6.py @@ -49,6 +49,7 @@ ModflowNam, ModflowTdis, ModflowUtllaktab, + ModflowUtlspca, ) from flopy.mf6.coordinates.modeldimensions import ( DataDimensions, @@ -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( diff --git a/flopy/mf6/mfpackage.py b/flopy/mf6/mfpackage.py index 747f1f6919..d7dcaabcea 100644 --- a/flopy/mf6/mfpackage.py +++ b/flopy/mf6/mfpackage.py @@ -1225,7 +1225,6 @@ def _get_package_info(self, dataset): ) return package_info_list - return None return None def _add_to_info_list(