Skip to content

Commit aab2c04

Browse files
mjrenomjreno
authored andcommitted
fix oc step indexing
1 parent 3516b69 commit aab2c04

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

flopy4/mf6/converter/unstructure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def oc_setting_data(rec):
100100
elif rec.steps.last:
101101
dat = {kper: "last" for kper in range(value.sizes["nper"])}
102102
elif rec.steps.steps:
103-
steps = " ".join(str(x - 1) for x in rec.steps.steps)
103+
steps = " ".join(str(x + 1) for x in rec.steps.steps)
104104
dat = {kper: f"steps {steps}" for kper in range(value.sizes["nper"])}
105105
elif rec.steps.all:
106106
# check last as this defaults to True

test/test_mf6_codec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_dumps_oc2():
124124
0: Oc.PrintSaveSetting(
125125
printrecord=[
126126
Oc.PrintRecord("head", Oc.Steps(first=True)),
127-
Oc.PrintRecord("budget", Oc.Steps(steps=(2, 3, 5))),
127+
Oc.PrintRecord("budget", Oc.Steps(steps=(0, 1, 3))),
128128
],
129129
saverecord=[
130130
Oc.SaveRecord("head", Oc.Steps(last=True)),

0 commit comments

Comments
 (0)