Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 7 additions & 6 deletions flopy4/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,16 @@ def _cmd_status(args: argparse.Namespace) -> None:
exe = shutil.which("mf6") or shutil.which("mf6.exe")
binary_version = _query_mf6_version(exe) if exe else None

synced = binary_version is not None and binary_version == MF6_VERSION
status = "(✓ in sync)" if synced else "(! mismatch)" if binary_version else "(not found)"

print(f"flopy4.mf6 synced to : {MF6_VERSION}")
print(f"DFN schema version : {DFN_SCHEMA_VERSION}")
if exe:
print(f"Discovered binary : {binary_version} [{exe}] {status}")
if not exe:
print("Discovered binary : (not found on PATH)")
elif binary_version is None:
print(f"Discovered binary : {exe} (version unknown)")
else:
print("Discovered binary : none (not found on PATH)")
synced = binary_version == MF6_VERSION and MF6_VERSION != "unknown"
status = "(✓ in sync)" if synced else "(! mismatch)"
print(f"Discovered binary : {binary_version} [{exe}] {status}")


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion flopy4/mf6/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import subprocess
import warnings

_VERSION_RE = re.compile(r"version\s+([\d]+\.[\d]+\.[\d]+(?:\.\S+)?)", re.I)
_VERSION_RE = re.compile(r"(?:version\s+|mf6:\s+)([\d]+\.[\d]+\.[\d]+(?:\.\S+)?)", re.I)


def _query_mf6_version(exe: str) -> str | None:
Expand Down
Loading