diff --git a/nowcasting_dataset/data_sources/gsp/live.py b/nowcasting_dataset/data_sources/gsp/live.py index 99f7ad0d..785ab5e7 100644 --- a/nowcasting_dataset/data_sources/gsp/live.py +++ b/nowcasting_dataset/data_sources/gsp/live.py @@ -67,7 +67,7 @@ def get_gsp_power_from_database( gsp_yield_dict = gsp_yield.__dict__ gsp_yield_dict["installed_capacity_mw"] = location.installed_capacity_mw - gsp_yield_dict["solar_generation_mw"] = gsp_yield_dict["solar_generation_kw"] * 1000 + gsp_yield_dict["solar_generation_mw"] = gsp_yield_dict["solar_generation_kw"] / 1000 gsp_yield_dict["gsp_id"] = location.gsp_id gsp_yields_dict.append(gsp_yield_dict) diff --git a/tests/data_sources/gsp/test_gsp_live.py b/tests/data_sources/gsp/test_gsp_live.py index 8f9ca3f2..859a5051 100644 --- a/tests/data_sources/gsp/test_gsp_live.py +++ b/tests/data_sources/gsp/test_gsp_live.py @@ -25,6 +25,8 @@ def test_get_pv_power_from_database(gsp_yields, db_session): pd.to_datetime(gsp_power.index[0]).isoformat() == datetime(2022, 1, 1, 0, 0, tzinfo=timezone.utc).isoformat() ) + assert gsp_power.max().max() < 1 + # this because units have changed from kw to mw @freeze_time("2022-01-01 05:00")