Skip to content

Commit

Permalink
Add --validate to inspect subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
gmertes committed Sep 25, 2024
1 parent b360785 commit acacc64
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/anemoi/inference/commands/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@


class InspectCmd(Command):
"""Inspect the contents of a checkpoint file."""

need_logging = False

def add_arguments(self, command_parser):
command_parser.add_argument("path", help="Path to the checkpoint.")
command_parser.add_argument("--dump", action="store_true", help="Print internal information")
command_parser.add_argument(
"--validate", action="store_true", help="Validate the current virtual environment against the checkpoint"
)

def run(self, args):

c = Checkpoint(args.path)

if args.validate:
c.validate_environment()
return

if args.dump:
c.dump()
return
Expand Down

0 comments on commit acacc64

Please sign in to comment.