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,