Skip to content

Commit 649a8ce

Browse files
mjrenomjreno
authored andcommitted
add gwf disu test
1 parent 3f6b84c commit 649a8ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4906
-139
lines changed

flopy4/array.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,18 @@ def load(cls, f, cwd, shape, header=True, **kwargs):
456456
nlay = params.get("dimensions").get("nlay")
457457
nrow = params.get("dimensions").get("nrow")
458458
ncol = params.get("dimensions").get("ncol")
459+
shape = (nlay, nrow, ncol)
460+
elif "disv" in mempath.split("/"):
461+
nlay = params.get("dimensions").get("nlay")
459462
ncpl = params.get("dimensions").get("ncpl")
463+
shape = (nlay, ncpl)
464+
elif "disu" in mempath.split("/"):
460465
nodes = params.get("dimensions").get("nodes")
461-
if nrow and ncol:
462-
shape = (nlay, nrow, ncol)
463-
elif ncpl:
464-
shape = (nlay, ncpl)
465-
elif nodes:
466+
nja = params.get("dimensions").get("nja")
467+
if "nodes" in shape:
466468
shape = nodes
469+
elif "nja" in shape:
470+
shape = nja
467471
if layered:
468472
nlay = shape[0]
469473
lshp = shape[1:]
@@ -554,7 +558,7 @@ def read_array(f, dtype):
554558
pos = f.tell()
555559
line = f.readline()
556560
line = line_strip(line)
557-
if not re.match("^[0-9. ]+$", line):
561+
if not re.match("^[-0-9. ]+$", line):
558562
f.seek(pos, 0)
559563
break
560564
astr.append(line)

flopy4/block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def load(cls, f, **kwargs):
236236
line = f.readline()
237237
if line == "":
238238
raise ValueError("Early EOF, aborting")
239-
if line == "\n":
239+
if line == "\n" or line.lstrip().startswith("#"):
240240
continue
241241
words = strip(line).lower().split()
242242
if period:

flopy4/compound.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ def load(cls, f, **kwargs) -> "MFList":
374374
while True:
375375
pos = f.tell()
376376
line = f.readline()
377-
if line.lower().startswith("end"):
377+
if line == "\n" or line.lstrip().startswith("#"):
378+
continue
379+
elif line.lower().startswith("end"):
378380
f.seek(pos)
379381
break
380382
else:

0 commit comments

Comments
 (0)