Skip to content

Commit 1d112bb

Browse files
authored
fix: skip interface model and connection variables (#95)
Defensive fix in case we ever start using interface models for PRT/CHF/OLF/SWF exchanges. A neater long-term solution might be distinguishing API-accessible variables from "internal" variables with a memory path prefix, but that implies changes on the MF6 side.
1 parent a28d7aa commit 1d112bb

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

modflowapi/extensions/apisimulation.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,25 @@ def load(mf6):
283283
id_var_addr = mf6.get_var_address("ID", name)
284284
if name.startswith("SLN"):
285285
continue
286-
elif name.startswith("GWTIM") or name.startswith("GWFIM") or name.startswith("GWEIM"):
286+
elif (
287+
name.startswith("GWFIM")
288+
or name.startswith("GWTIM")
289+
or name.startswith("GWEIM")
290+
or name.startswith("PRTIM")
291+
or name.startswith("CHFIM")
292+
or name.startswith("OLFIM")
293+
or name.startswith("SWFIM")
294+
):
287295
continue
288-
elif name.startswith("GWFCON") or name.startswith("GWTCON") or name.startswith("GWECON"):
296+
elif (
297+
name.startswith("GWFCON")
298+
or name.startswith("GWTCON")
299+
or name.startswith("GWECON")
300+
or name.startswith("PRTCON")
301+
or name.startswith("CHFCON")
302+
or name.startswith("OLFCON")
303+
or name.startswith("SWFCON")
304+
):
289305
continue
290306
if id_var_addr not in variables:
291307
continue
@@ -305,7 +321,15 @@ def load(mf6):
305321
id_var_addr = mf6.get_var_address("ID", name)
306322
if name.lower() in models or name == "TDIS":
307323
continue
308-
if name.startswith("GWTIM") or name.startswith("GWFIM") or name.startswith("GWEIM"):
324+
if (
325+
name.startswith("GWFIM")
326+
or name.startswith("GWTIM")
327+
or name.startswith("GWEIM")
328+
or name.startswith("PRTIM")
329+
or name.startswith("CHFIM")
330+
or name.startswith("OLFIM")
331+
or name.startswith("SWFIM")
332+
):
309333
continue
310334
if id_var_addr not in variables:
311335
continue

0 commit comments

Comments
 (0)