Skip to content

Commit

Permalink
Fix: Address review comments
Browse files Browse the repository at this point in the history
- ekd instead of earthkit.data
- Use 'valid_time' instead of 'base_time'
  • Loading branch information
HCookie committed Sep 4, 2024
1 parent 00c397a commit cba7014
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/anemoi/inference/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@


def forcing_and_constants(source, date, param):
import earthkit
import earthkit.data as ekd

ds = earthkit.data.from_source(
ds = ekd.from_source(
"forcings",
source,
date=date,
Expand Down Expand Up @@ -227,9 +227,8 @@ def run(
start_datetime = input_fields.order_by(valid_datetime="ascending")[-1].datetime()

if isinstance(start_datetime, dict):
start_datetime = start_datetime[
"base_time"
] # With earthkit, time is a dictionary with 'base_time' and 'valid_time'
# With earthkit, time is a dictionary with 'base_time' and 'valid_time'
start_datetime = start_datetime["valid_time"]

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

0 comments on commit cba7014

Please sign in to comment.