Skip to content

Commit

Permalink
cleaning tests
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Jul 12, 2024
1 parent ced772c commit 6521a98
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/anemoi/registry/commands/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def add_arguments(self, command_parser):
)
# command_parser.add_argument("--delete", help=f"Delete the {self.kind} from the catalogue and from any other location", action="store_true")
command_parser.add_argument("--set-status", help="Set the status to the {self.kind}.")
command_parser.add_argument("--add-recipe", help="Add the recipe file to [re-]build the {self.kind}.")
command_parser.add_argument("--set-recipe", help="Set the recipe file to [re-]build the {self.kind}.")
command_parser.add_argument(
"--add-location",
nargs="+",
Expand All @@ -55,7 +55,7 @@ def _run(self, entry, args):
self.process_task(entry, args, "register")
# self.process_task(entry, args, "remove_location")
self.process_task(entry, args, "add_location", platform=args.platform)
self.process_task(entry, args, "add_recipe")
self.process_task(entry, args, "set_recipe")
self.process_task(entry, args, "set_status")


Expand Down
2 changes: 1 addition & 1 deletion src/anemoi/registry/entry/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def set_status(self, status):
def add_location(self, path, platform):
self.rest_item.patch([{"op": "add", "path": f"/locations/{platform}", "value": {"path": path}}])

def add_recipe(self, file):
def set_recipe(self, file):
if not os.path.exists(file):
raise FileNotFoundError(f"Recipe file not found: {file}")
if not file.endswith(".yaml"):
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy-recipe-dataset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ common:

dates:
start: 2020-12-30 00:00:00
end: 2021-01-03 12:00:00
frequency: 12h
end: 2021-01-03 18:00:00
frequency: 6h

input:
join:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def teardown_module(raise_if_error=True):
def test_datasets():
# assert run("anemoi-registry", "datasets", TMP_DATASET) == 1
run("anemoi-registry", "datasets", TMP_DATASET)
run("anemoi-registry", "datasets", TMP_DATASET, "--add-recipe", "./dummy-recipe-dataset.yaml")
run("anemoi-registry", "datasets", TMP_DATASET, "--set-recipe", "./dummy-recipe-dataset.yaml")
run("anemoi-registry", "datasets", TMP_DATASET, "--set-status", "testing")
run("anemoi-registry", "datasets", TMP_DATASET, "--add-location", "/the/dataset/path", "--platform", "atos")
run("anemoi-registry", "datasets", TMP_DATASET, "--add-location", "/other/path", "--platform", "leonardo")
Expand Down

0 comments on commit 6521a98

Please sign in to comment.