Skip to content

Commit 41ae04e

Browse files
committed
write some tests and stick grid and time in model and sim respectively as attrs. maybe the way to go? but we need to repeat them in all relevant packages in that case. we could maybe also do a decorator that adds grid/time via field_transformer? but that's probably too fancy
1 parent fc09610 commit 41ae04e

File tree

4 files changed

+129
-55
lines changed

4 files changed

+129
-55
lines changed

flopy4/mf6/gwf/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import imod
66
import xarray as xr
77
from attrs import define
8+
from flopy.discretization.grid import Grid
89
from xattree import field, xattree
910

1011
from flopy4.mf6.gwf.chd import Chd
@@ -47,6 +48,7 @@ def budget(self):
4748
output: Output = attrs.field(
4849
default=attrs.Factory(lambda self: Gwf.Output(self), takes_self=True)
4950
)
51+
grid: Grid = attrs.field(default=None)
5052

5153
@define
5254
class NewtonOptions:

flopy4/mf6/simulation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pathlib import Path
22

3+
import attrs
34
from xattree import field, xattree
45

56
from flopy4.mf6.component import Component
@@ -8,6 +9,8 @@
89
from flopy4.mf6.solution import Solution
910
from flopy4.mf6.tdis import Tdis
1011

12+
from flopy.discretization.modeltime import ModelTime
13+
1114

1215
@xattree
1316
class Simulation(Component):
@@ -16,3 +19,4 @@ class Simulation(Component):
1619
solutions: dict[str, Solution] = field()
1720
tdis: Tdis = field()
1821
sim_ws: Path = field(default=None)
22+
time: ModelTime = attrs.field(default=None)

0 commit comments

Comments
 (0)