From 729fdd1bea1b15e4f85cd2941b5c3d7614ecf20e Mon Sep 17 00:00:00 2001 From: Gert Mertes Date: Tue, 10 Sep 2024 13:38:09 +0000 Subject: [PATCH] Fix valid datetime --- src/ai_models/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ai_models/model.py b/src/ai_models/model.py index e143772..20d8e16 100644 --- a/src/ai_models/model.py +++ b/src/ai_models/model.py @@ -523,7 +523,7 @@ def gridpoints(self): @cached_property def start_datetime(self): - return self.all_fields.order_by(valid_datetime="ascending")[-1].datetime() + return self.all_fields.order_by(valid_datetime="ascending")[-1].datetime()["valid_time"] @property def constant_fields(self): @@ -545,7 +545,7 @@ def write_input_fields( if field.metadata("shortName") in ignore: continue - if field.valid_datetime() == self.start_datetime: + if field.datetime()["valid_time"] == self.start_datetime: self.write( None, template=field,