From 57523b414beea618fa2e7dd203b8c73883fd24a0 Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Tue, 21 May 2024 10:42:48 +0100 Subject: [PATCH] First commits --- .gitignore | 1 + pyproject.toml | 14 +++----------- .../commands/{hello.py => checkpoint.py} | 17 ++++++----------- 3 files changed, 10 insertions(+), 22 deletions(-) rename src/anemoi/inference/commands/{hello.py => checkpoint.py} (59%) diff --git a/.gitignore b/.gitignore index d8baf06..8ce211b 100644 --- a/.gitignore +++ b/.gitignore @@ -185,3 +185,4 @@ _build/ ~* *.sync _version.py +*.ckpt diff --git a/pyproject.toml b/pyproject.toml index ae983a8..8157e05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,9 +39,7 @@ classifiers = [ "Operating System :: OS Independent", ] -dependencies = [ - -] +dependencies = ["anemoi-utils"] [project.optional-dependencies] @@ -50,15 +48,9 @@ docs = [ # For building the documentation ] -all = [ -] +all = [] -dev = [ - "sphinx", - "sphinx_rtd_theme", - "nbsphinx", - "pandoc", -] +dev = ["sphinx", "sphinx_rtd_theme", "nbsphinx", "pandoc"] [project.urls] Homepage = "https://github.com/ecmwf/anemoi-inference/" diff --git a/src/anemoi/inference/commands/hello.py b/src/anemoi/inference/commands/checkpoint.py similarity index 59% rename from src/anemoi/inference/commands/hello.py rename to src/anemoi/inference/commands/checkpoint.py index 12a0495..39ef06d 100644 --- a/src/anemoi/inference/commands/hello.py +++ b/src/anemoi/inference/commands/checkpoint.py @@ -8,25 +8,20 @@ # nor does it submit to any jurisdiction. # -"""Command place holder. Delete when we have real commands. - -""" +from ..checkpoint import Checkpoint from . import Command -def say_hello(greetings, who): - print(greetings, who) - +class CheckpointCmd(Command): -class Hello(Command): + need_logging = False def add_arguments(self, command_parser): - command_parser.add_argument("--greetings", default="hello") - command_parser.add_argument("--who", default="world") + command_parser.add_argument("path", help="Path to the checkpoint.") def run(self, args): - say_hello(args.greetings, args.who) + Checkpoint(args.path).describe() -command = Hello +command = CheckpointCmd