Skip to content

Commit 06e14c2

Browse files
authored
ensure period in block order is last (#309)
1 parent d2525e5 commit 06e14c2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

modflow_devtools/dfns/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ def load(f, format: str = "dfn", **kwargs) -> Dfn:
613613
fields, meta = parse_dfn(f, **kwargs)
614614
blocks = {
615615
block_name: {field["name"]: FieldV1.from_dict(field) for field in block}
616-
for block_name, block in groupby(fields.values(), lambda field: field["block"])
616+
for block_name, block in groupby(
617+
fields.values(multi=True), lambda field: field["block"]
618+
)
617619
}
618620
subcomponents = parse_mf6_subpackages(meta)
619621
return Dfn(

modflow_devtools/dfns/schema/block.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ def block_sort_key(item) -> int:
1414
return 1
1515
elif k == "griddata":
1616
return 2
17-
elif k == "packagedata":
18-
return 3
1917
elif "period" in k:
2018
return 4
2119
else:
22-
return 5
20+
return 3

0 commit comments

Comments
 (0)