Skip to content

Commit

Permalink
feat: make-additions-optional-in-config-setting-build.additions-to-fa…
Browse files Browse the repository at this point in the history
…lse (#169)
  • Loading branch information
floriankrb authored Jan 14, 2025
1 parent 558fae1 commit 1cfd35b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/anemoi/datasets/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ def serial_create(self, args):
task("load", options)
task("finalise", options)

task("patch", options)

task("init_additions", options)
task("run_additions", options)
task("finalise_additions", options)

task("patch", options)

task("cleanup", options)
task("verify", options)

Expand Down Expand Up @@ -153,6 +154,7 @@ def parallel_create(self, args):

with ExecutorClass(max_workers=1) as executor:
executor.submit(task, "finalise-additions", options).result()
executor.submit(task, "patch", options).result()
executor.submit(task, "cleanup", options).result()
executor.submit(task, "verify", options).result()

Expand Down
5 changes: 5 additions & 0 deletions src/anemoi/datasets/create/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,11 @@ def skip(self):
if not self.delta.total_seconds() % frequency.total_seconds() == 0:
LOG.debug(f"Delta {self.delta} is not a multiple of frequency {frequency}. Skipping.")
return True

if self.dataset.zarr_metadata.get("build", {}).get("additions", None) is False:
LOG.warning(f"Additions are disabled for {self.path} in the recipe.")
return True

return False

@cached_property
Expand Down

0 comments on commit 1cfd35b

Please sign in to comment.