From 3f64342ce4325d324b8c40ad3e9562bca8f04857 Mon Sep 17 00:00:00 2001 From: James Fulton Date: Wed, 14 Aug 2024 13:07:13 +0000 Subject: [PATCH] add check solar coords check to pvent samples --- tests/torch_datasets/test_pvnet_uk_regional.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/torch_datasets/test_pvnet_uk_regional.py b/tests/torch_datasets/test_pvnet_uk_regional.py index 6991ecc..ff5c2fe 100644 --- a/tests/torch_datasets/test_pvnet_uk_regional.py +++ b/tests/torch_datasets/test_pvnet_uk_regional.py @@ -35,7 +35,10 @@ def test_pvnet(pvnet_config_filename): assert isinstance(sample, dict) - for key in [BatchKey.nwp, BatchKey.satellite_actual, BatchKey.gsp]: + for key in [ + BatchKey.nwp, BatchKey.satellite_actual, BatchKey.gsp, + BatchKey.gsp_solar_azimuth, BatchKey.gsp_solar_elevation, + ]: assert key in sample for nwp_source in ["ukv"]: @@ -48,6 +51,9 @@ def test_pvnet(pvnet_config_filename): assert sample[BatchKey.nwp]["ukv"][NWPBatchKey.nwp].shape == (4, 1, 2, 2) # 3 hours of 30 minute data (inclusive) assert sample[BatchKey.gsp].shape == (7,) + # Solar angles have same shape as GSP data + assert sample[BatchKey.gsp_solar_azimuth].shape == (7,) + assert sample[BatchKey.gsp_solar_elevation].shape == (7,)