Skip to content

Commit 151f261

Browse files
committed
version comparison fix
1 parent 2dd65bf commit 151f261

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

modflow_devtools/dfns/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,11 +575,12 @@ def map(
575575
schema_version: str | Version = "2",
576576
) -> Dfn:
577577
"""Map a MODFLOW 6 specification to another schema version."""
578-
if dfn.schema_version == schema_version:
578+
version = Version(str(schema_version))
579+
if version == dfn.schema_version:
579580
return dfn
580-
elif Version(str(schema_version)) == Version("1"):
581+
elif version == Version("1"):
581582
raise NotImplementedError("Mapping to schema version 1 is not implemented yet.")
582-
elif Version(str(schema_version)) == Version("2"):
583+
elif version == Version("2"):
583584
return MapV1To2().map(dfn)
584585
raise ValueError(f"Unsupported schema version: {schema_version}. Expected 1 or 2.")
585586

0 commit comments

Comments
 (0)