Skip to content

Commit bdde703

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 9f385dc commit bdde703

File tree

4 files changed

+89
-16
lines changed

4 files changed

+89
-16
lines changed

flopy4/mf6/gwf/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from pathlib import Path
22
from typing import Optional
33

4+
import attrs
45
from attrs import define
6+
from flopy.discretization.grid import Grid
57
from xattree import field, xattree
68

79
from flopy4.mf6.gwf.chd import Chd
@@ -21,6 +23,7 @@ class Gwf(Model):
2123
oc: Oc = field()
2224
npf: Npf = field()
2325
chd: list[Chd] = field()
26+
grid: Grid = attrs.field(default=None)
2427

2528
@define
2629
class NewtonOptions:

flopy4/mf6/simulation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import attrs
2+
from flopy.discretization.modeltime import ModelTime
13
from xattree import field, xattree
24

35
from flopy4.mf6.component import Component
@@ -13,3 +15,4 @@ class Simulation(Component):
1315
exchanges: dict[str, Exchange] = field()
1416
solutions: dict[str, Solution] = field()
1517
tdis: Tdis = field()
18+
time: ModelTime = attrs.field(default=None)

pixi.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)