Skip to content

Commit 1cfd35b

Browse files
authored
feat: make-additions-optional-in-config-setting-build.additions-to-false (#169)
1 parent 558fae1 commit 1cfd35b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/anemoi/datasets/commands/create.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ def serial_create(self, args):
8383
task("load", options)
8484
task("finalise", options)
8585

86-
task("patch", options)
87-
8886
task("init_additions", options)
8987
task("run_additions", options)
9088
task("finalise_additions", options)
89+
90+
task("patch", options)
91+
9192
task("cleanup", options)
9293
task("verify", options)
9394

@@ -153,6 +154,7 @@ def parallel_create(self, args):
153154

154155
with ExecutorClass(max_workers=1) as executor:
155156
executor.submit(task, "finalise-additions", options).result()
157+
executor.submit(task, "patch", options).result()
156158
executor.submit(task, "cleanup", options).result()
157159
executor.submit(task, "verify", options).result()
158160

src/anemoi/datasets/create/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,11 @@ def skip(self):
740740
if not self.delta.total_seconds() % frequency.total_seconds() == 0:
741741
LOG.debug(f"Delta {self.delta} is not a multiple of frequency {frequency}. Skipping.")
742742
return True
743+
744+
if self.dataset.zarr_metadata.get("build", {}).get("additions", None) is False:
745+
LOG.warning(f"Additions are disabled for {self.path} in the recipe.")
746+
return True
747+
743748
return False
744749

745750
@cached_property

0 commit comments

Comments
 (0)