Skip to content

Commit a6179c2

Browse files
mjrenowpbonelli
authored andcommitted
xattree update
1 parent 46076aa commit a6179c2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

flopy4/mf6/interface/flopy3.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def __init__(
195195
for a in self._data.attrs:
196196
if a == "host":
197197
continue
198-
if self._data.attrs[a] is not None and self._spec[a].type is not None:
198+
if self._data.attrs[a] is not None and a in self._spec and self._spec[a].type is not None:
199199
d_fp3 = Flopy3Data(
200200
data=self._data.attrs[a],
201201
spec=self._spec[a],
@@ -208,7 +208,11 @@ def __init__(
208208
self._dlist.append(d_fp3)
209209

210210
for v in self._data.data_vars:
211-
if self._data.data_vars[v] is not None:
211+
if (
212+
self._data.data_vars[v] is not None
213+
and v in self._spec.flat
214+
and self._spec.flat[v].type is not None
215+
):
212216
d_fp3 = Flopy3Data(
213217
data=self._data.data_vars[v],
214218
spec=self._spec[v],

0 commit comments

Comments
 (0)