22from datetime import datetime
33
44import pandas as pd
5+ import pytest
56import pytz
67
78from nowcasting_dataset .data_sources .gsp .pvlive import (
1011)
1112
1213
14+ @pytest .mark .skip ("Skip due to PVlive server issues: #395" )
1315def test_load_gsp_raw_data_from_pvlive_one_gsp_one_day ():
1416 """
1517 Test that one gsp system data can be loaded, just for one day
@@ -26,6 +28,7 @@ def test_load_gsp_raw_data_from_pvlive_one_gsp_one_day():
2628 assert "generation_mw" in gsp_pv_df .columns
2729
2830
31+ @pytest .mark .skip ("Skip due to PVlive server issues: #395" )
2932def test_load_gsp_raw_data_from_pvlive_one_gsp_one_day_not_normalised ():
3033 """
3134 Test that one gsp system data can be loaded, just for one day, and is normalized correctly
@@ -46,6 +49,7 @@ def test_load_gsp_raw_data_from_pvlive_one_gsp_one_day_not_normalised():
4649 assert gsp_pv_df ["generation_mw" ].max () <= 1
4750
4851
52+ @pytest .mark .skip ("Skip due to PVlive server issues: #395" )
4953def test_load_gsp_raw_data_from_pvlive_one_gsp ():
5054 """
5155 Test that one gsp system data can be loaded
@@ -63,6 +67,7 @@ def test_load_gsp_raw_data_from_pvlive_one_gsp():
6367 assert "generation_mw" in gsp_pv_df .columns
6468
6569
70+ @pytest .mark .skip ("Skip due to PVlive server issues: #395" )
6671def test_load_gsp_raw_data_from_pvlive_many_gsp ():
6772 """
6873 Test that one gsp system data can be loaded
@@ -71,22 +76,23 @@ def test_load_gsp_raw_data_from_pvlive_many_gsp():
7176 start = datetime (2021 , 1 , 1 , tzinfo = pytz .utc )
7277 end = datetime (2021 , 1 , 2 , tzinfo = pytz .utc )
7378
74- gsp_pv_df = load_pv_gsp_raw_data_from_pvlive (start = start , end = end , number_of_gsp = 10 )
79+ gsp_pv_df = load_pv_gsp_raw_data_from_pvlive (start = start , end = end , number_of_gsp = 3 )
7580
7681 assert isinstance (gsp_pv_df , pd .DataFrame )
77- assert len (gsp_pv_df ) == (48 + 1 ) * 10
82+ assert len (gsp_pv_df ) == (48 + 1 ) * 3
7883 assert "datetime_gmt" in gsp_pv_df .columns
7984 assert "generation_mw" in gsp_pv_df .columns
8085
8186
87+ @pytest .mark .skip ("Skip due to PVlive server issues: #395" )
8288def test_get_installed_capacity ():
8389 """
8490 Test thhat we can get installed capacity
8591 """
8692
87- installed_capacity = get_installed_capacity (maximum_number_of_gsp = 10 )
93+ installed_capacity = get_installed_capacity (maximum_number_of_gsp = 3 )
8894
89- assert len (installed_capacity ) == 10
95+ assert len (installed_capacity ) == 3
9096 assert "installedcapacity_mwp" == installed_capacity .name
9197 assert installed_capacity .iloc [0 ] == 342.02623
92- assert installed_capacity .iloc [9 ] == 308.00432
98+ assert installed_capacity .iloc [2 ] == 308.00432
0 commit comments