Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit c161e5e

Browse files
Merge pull request #713 from openclimatefix/issue/fix-gsp
gsp unit conversation
2 parents c69beda + 61e8c02 commit c161e5e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

nowcasting_dataset/data_sources/gsp/live.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_gsp_power_from_database(
6767

6868
gsp_yield_dict = gsp_yield.__dict__
6969
gsp_yield_dict["installed_capacity_mw"] = location.installed_capacity_mw
70-
gsp_yield_dict["solar_generation_mw"] = gsp_yield_dict["solar_generation_kw"] * 1000
70+
gsp_yield_dict["solar_generation_mw"] = gsp_yield_dict["solar_generation_kw"] / 1000
7171
gsp_yield_dict["gsp_id"] = location.gsp_id
7272
gsp_yields_dict.append(gsp_yield_dict)
7373

tests/data_sources/gsp/test_gsp_live.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def test_get_pv_power_from_database(gsp_yields, db_session):
2525
pd.to_datetime(gsp_power.index[0]).isoformat()
2626
== datetime(2022, 1, 1, 0, 0, tzinfo=timezone.utc).isoformat()
2727
)
28+
assert gsp_power.max().max() < 1
29+
# this because units have changed from kw to mw
2830

2931

3032
@freeze_time("2022-01-01 05:00")

0 commit comments

Comments
 (0)