Skip to content

Commit

Permalink
Fix valid datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
gmertes committed Sep 10, 2024
1 parent 1f973e4 commit 729fdd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ai_models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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,
Expand Down

0 comments on commit 729fdd1

Please sign in to comment.