From 590e43863ed9fd9d45c591c82080f475a430eda0 Mon Sep 17 00:00:00 2001 From: Gert Mertes Date: Mon, 1 Jul 2024 10:13:02 +0000 Subject: [PATCH] Fix hindcasts --- src/ai_models/outputs/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ai_models/outputs/__init__.py b/src/ai_models/outputs/__init__.py index 22a8563..0e395bc 100644 --- a/src/ai_models/outputs/__init__.py +++ b/src/ai_models/outputs/__init__.py @@ -73,9 +73,9 @@ def write(self, data, *args, check=False, **kwargs): # Check that the GRIB keys are as expected if kwargs.get("expver") is None: - ignore = ("template", "expver", "class", "type", "stream") + ignore = ("template", "check_nans", "expver", "class", "type", "stream") else: - ignore = ("template",) + ignore = ("template", "check_nans") for key, value in itertools.chain(self.grib_keys.items(), kwargs.items()): if key in ignore: @@ -155,6 +155,9 @@ def write(self, *args, **kwargs): return self.output.write(*args, **kwargs) + def flush(self, *args, **kwargs): + return self.output.flush(*args, **kwargs) + class NoLabelling: @@ -166,6 +169,9 @@ def write(self, *args, **kwargs): kwargs["deleteLocalDefinition"] = 1 return self.output.write(*args, **kwargs) + def flush(self, *args, **kwargs): + return self.output.flush(*args, **kwargs) + def get_output(name, owner, *args, **kwargs): result = available_outputs()[name].load()(owner, *args, **kwargs)