From 7e7999e026a2720d39a6693df3c04971b502f1ee Mon Sep 17 00:00:00 2001 From: Rosheen Naeem Date: Tue, 12 Mar 2024 08:31:24 +0100 Subject: [PATCH] Evaluate (#83) * fixed the path to testset in evaluation script * debugging the get_nwp function * Added comment * removed unnecessary --- .gitignore | 2 +- quartz_solar_forecast/eval/nwp.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4b724715..00b8ec74 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ scripts/datapipes/test.nc scripts/datapipes/UK_PV_metadata.csv scripts/datapipes/nwp_data -quartz_solar_forecast/data \ No newline at end of file +quartz_solar_forecast/data diff --git a/quartz_solar_forecast/eval/nwp.py b/quartz_solar_forecast/eval/nwp.py index ac32f59d..fc4183a2 100644 --- a/quartz_solar_forecast/eval/nwp.py +++ b/quartz_solar_forecast/eval/nwp.py @@ -80,6 +80,10 @@ def get_nwp_for_one_timestamp_one_location( # fs = HfFileSystem() # print(fs.ls("datasets/openclimatefix/dwd-icon-eu/data/2022/4/11/", detail=False)) + # Ensure timestamp is a pd.Timestamp object + if not isinstance(timestamp, pd.Timestamp): + timestamp = pd.to_datetime(timestamp) + # round timestamp to 6 hours floor timestamp_floor = timestamp.floor("6h") date_and_hour, huggingface_file = make_hf_filename(timestamp_floor) @@ -170,5 +174,3 @@ def get_nwp_for_one_timestamp_one_location( print(f"Getting NWP for {timestamp} {pv_id}. Progress: {100*progress}%") return df - -