Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions modflow_devtools/dfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def block_sort_key(item) -> int:
]


_SCALAR_TYPES = ("keyword", "integer", "double precision", "string")
SCALAR_TYPES = ("keyword", "integer", "double precision", "string")
_SCALAR_TYPES = SCALAR_TYPES # allow backwards compat; imported by flopy


Dfns = dict[str, "Dfn"]
Expand All @@ -130,7 +131,7 @@ def get_blocks(dfn: "Dfn") -> Blocks:
"""

def _is_block(item: tuple[str, Any]) -> bool:
k, v = item
k, _v = item
return k not in Dfn.__annotations__

return dict(
Expand Down Expand Up @@ -455,7 +456,7 @@ def _item() -> Field:
return _convert_field(next(iter(flat.getlist(item_names[0]))))

# implicit simple record (no children)
if all(t in _SCALAR_TYPES for t in item_types):
if all(t in SCALAR_TYPES for t in item_types):
return Field(
name=_name,
type="record",
Expand Down Expand Up @@ -543,7 +544,7 @@ def _fields() -> Fields:
# for now, we can tell a var is an array if its type
# is scalar and it has a shape. once we have proper
# typing, this can be read off the type itself.
elif shape is not None and _type not in _SCALAR_TYPES:
elif shape is not None and _type not in SCALAR_TYPES:
raise TypeError(f"Unsupported array type: {_type}")

else:
Expand Down