Skip to content

Commit 54e27ff

Browse files
authored
minor cleanup for xattree compat, update uv.lock (#90)
1 parent bb72343 commit 54e27ff

File tree

2 files changed

+87
-87
lines changed

2 files changed

+87
-87
lines changed

flopy4/mf6/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
from pathlib import Path
44
from typing import Optional
55

6-
from attr import Factory, field
6+
import numpy as np
7+
from attr import field
78
from attrs import define
8-
from xattree import array, child, xattree
9+
from numpy.typing import NDArray
10+
from xattree import array, child, dim, xattree
911

1012
__all__ = [
1113
"Component",
@@ -58,16 +60,15 @@ class PeriodData:
5860
nstp: int = field(default=1)
5961
tsmult: float = field(default=1.0)
6062

61-
nper: int = field(
63+
nper: int = dim(
64+
coord="kper",
65+
scope="simulation",
6266
default=1,
63-
metadata={
64-
"block": "dimensions",
65-
"dim": {"coord": "kper", "scope": "simulation"},
66-
},
67+
metadata={"block": "dimensions"},
6768
)
68-
perioddata: list[PeriodData] = array(
69+
perioddata: NDArray[np.object_] = array(
70+
PeriodData,
6971
dims=("nper",),
70-
default=Factory(list),
7172
metadata={"block": "perioddata"},
7273
)
7374
time_units: Optional[str] = field(

0 commit comments

Comments
 (0)