From acacc64c9906ce59ad94f688b93d4c631551af63 Mon Sep 17 00:00:00 2001 From: Gert Mertes Date: Wed, 25 Sep 2024 11:58:55 +0000 Subject: [PATCH] Add --validate to inspect subcommand --- src/anemoi/inference/commands/inspect.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/anemoi/inference/commands/inspect.py b/src/anemoi/inference/commands/inspect.py index 36b1691..9d2e970 100644 --- a/src/anemoi/inference/commands/inspect.py +++ b/src/anemoi/inference/commands/inspect.py @@ -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