From cba70143fb4aa80cac3fc27a85e61f437b2b942a Mon Sep 17 00:00:00 2001 From: Harrison Cook Date: Wed, 4 Sep 2024 14:49:20 +0000 Subject: [PATCH] Fix: Address review comments - ekd instead of earthkit.data - Use 'valid_time' instead of 'base_time' --- src/anemoi/inference/runner.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/anemoi/inference/runner.py b/src/anemoi/inference/runner.py index 951faec..4f510a2 100644 --- a/src/anemoi/inference/runner.py +++ b/src/anemoi/inference/runner.py @@ -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, @@ -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],