Skip to content

Commit 09a254a

Browse files
committed
no need for slnfname
1 parent af9db17 commit 09a254a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

flopy4/mf6/solution.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
from abc import ABC
2-
from pathlib import Path
3-
from typing import ClassVar, Optional
2+
from typing import ClassVar
43

54
import attrs
6-
from xattree import field, xattree
5+
from xattree import xattree
76

87
from flopy4.mf6.package import Package
98

109

1110
@xattree
1211
class Solution(Package, ABC):
1312
slntype: ClassVar[str] = "sln"
14-
15-
slnfname: Optional[Path] = field(default=None) # type: ignore
1613
models: list[str] = attrs.field(default=attrs.Factory(list))
1714

1815
def default_filename(self) -> str:
19-
return str(self.slnfname) if self.slnfname else f"solution.{self.slntype.lower()}"
16+
return f"solution.{self.slntype.lower()}"

test/test_component.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def test_gwf_chd01(function_tmpdir):
283283
time = ModelTime(perlen=[5.0], nstp=[1], tsmult=[1.0], time_units="days")
284284

285285
ims = Ims(
286-
slnfname="sln1.ims",
286+
filename="sln1.ims",
287287
models=[gwf_name],
288288
print_option="summary",
289289
outer_dvclose=1.00000000e-06,
@@ -350,6 +350,15 @@ def test_gwf_chd01(function_tmpdir):
350350
sim.write()
351351
sim.run()
352352

353+
assert Path(function_tmpdir, f"{sim_name}.tdis").is_file()
354+
assert Path(function_tmpdir, f"{gwf_name}.nam").is_file()
355+
assert Path(function_tmpdir, f"{gwf_name}.dis").is_file()
356+
assert Path(function_tmpdir, f"{gwf_name}.ic").is_file()
357+
assert Path(function_tmpdir, f"{gwf_name}.oc").is_file()
358+
assert Path(function_tmpdir, f"{gwf_name}.npf").is_file()
359+
assert Path(function_tmpdir, f"{gwf_name}.chd").is_file()
360+
assert Path(function_tmpdir, "sln1.ims").is_file()
361+
353362

354363
def test_quickstart(function_tmpdir):
355364
sim_name = "quickstart"

0 commit comments

Comments
 (0)