Skip to content

Commit 52ea5bb

Browse files
mjrenomjreno
mjreno
authored and
mjreno
committed
xattree update
1 parent a8f4ba9 commit 52ea5bb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

flopy4/mf6/interface/flopy3.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from flopy.mbase import ModelInterface
1111
from flopy.pakbase import PackageInterface
1212
from flopy.plot.plotutil import PlotUtilities
13-
from xattree import _get_xatspec, _Xattribute
13+
from xattree import Xattribute, _get_xatspec
1414

1515
from flopy4.mf6.model import Model
1616
from flopy4.mf6.package import Package
@@ -197,6 +197,7 @@ def __init__(
197197
for a in self._data.attrs:
198198
if (
199199
self._data.attrs[a] is not None
200+
and a in self._spec.flat
200201
and self._spec.flat[a].type is not None
201202
):
202203
d_fp3 = Flopy3Data(
@@ -211,7 +212,11 @@ def __init__(
211212
self._dlist.append(d_fp3)
212213

213214
for v in self._data.data_vars:
214-
if self._data.data_vars[v] is not None:
215+
if (
216+
self._data.data_vars[v] is not None
217+
and v in self._spec.flat
218+
and self._spec.flat[v].type is not None
219+
):
215220
d_fp3 = Flopy3Data(
216221
data=self._data.data_vars[v],
217222
spec=self._spec.flat[v],
@@ -276,7 +281,7 @@ class Flopy3Data(DataInterface):
276281
def __init__(
277282
self,
278283
data,
279-
spec: _Xattribute,
284+
spec: Xattribute,
280285
name: Optional[str] = None,
281286
modelname: Optional[str] = None,
282287
modelgrid: Optional[Grid] = None,

0 commit comments

Comments
 (0)