Skip to content

Commit

Permalink
Fix: Address valid_time retrieval comment
Browse files Browse the repository at this point in the history
  • Loading branch information
HCookie committed Sep 4, 2024
1 parent d264d45 commit 60e634f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/anemoi/inference/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,8 @@ def run(
]

if start_datetime is None:
start_datetime = input_fields.order_by(valid_datetime="ascending")[-1].datetime()

if isinstance(start_datetime, dict):
# With earthkit, time is a dictionary with 'base_time' and 'valid_time'
start_datetime = start_datetime["valid_time"]
start_datetime_str = input_fields.order_by(valid_datetime="ascending")[-1].metadata("valid_datetime")
start_datetime = datetime.datetime.fromisoformat(start_datetime_str)

constants = forcing_and_constants(
source=input_fields[:1],
Expand Down

0 comments on commit 60e634f

Please sign in to comment.