@@ -78,7 +78,7 @@ def test_get_psm3_tmy(nrel_api_key):
78
78
"""test get_psm3 with a TMY"""
79
79
data , metadata = psm3 .get_psm3 (LATITUDE , LONGITUDE , nrel_api_key ,
80
80
PVLIB_EMAIL , names = 'tmy-2017' ,
81
- map_variables = False )
81
+ leap_day = False , map_variables = False )
82
82
expected = pd .read_csv (TMY_TEST_DATA )
83
83
assert_psm3_equal (data , metadata , expected )
84
84
@@ -89,7 +89,8 @@ def test_get_psm3_singleyear(nrel_api_key):
89
89
"""test get_psm3 with a single year"""
90
90
data , metadata = psm3 .get_psm3 (LATITUDE , LONGITUDE , nrel_api_key ,
91
91
PVLIB_EMAIL , names = '2017' ,
92
- map_variables = False , interval = 30 )
92
+ leap_day = False , map_variables = False ,
93
+ interval = 30 )
93
94
expected = pd .read_csv (YEAR_TEST_DATA )
94
95
assert_psm3_equal (data , metadata , expected )
95
96
@@ -100,7 +101,7 @@ def test_get_psm3_5min(nrel_api_key):
100
101
"""test get_psm3 for 5-minute data"""
101
102
data , metadata = psm3 .get_psm3 (LATITUDE , LONGITUDE , nrel_api_key ,
102
103
PVLIB_EMAIL , names = '2019' , interval = 5 ,
103
- map_variables = False )
104
+ leap_day = False , map_variables = False )
104
105
assert len (data ) == 525600 / 5
105
106
first_day = data .loc ['2019-01-01' ]
106
107
expected = pd .read_csv (YEAR_TEST_DATA_5MIN )
@@ -137,7 +138,8 @@ def test_get_psm3_tmy_errors(
137
138
"""
138
139
with pytest .raises (HTTPError ) as excinfo :
139
140
psm3 .get_psm3 (latitude , longitude , api_key , PVLIB_EMAIL ,
140
- names = names , interval = interval , map_variables = False )
141
+ names = names , interval = interval , leap_day = False ,
142
+ map_variables = False )
141
143
# ensure the HTTPError caught isn't due to overuse of the API key
142
144
assert "OVER_RATE_LIMIT" not in str (excinfo .value )
143
145
@@ -186,7 +188,7 @@ def test_get_psm3_attribute_mapping(nrel_api_key):
186
188
data , meta = psm3 .get_psm3 (LATITUDE , LONGITUDE , nrel_api_key , PVLIB_EMAIL ,
187
189
names = 2019 , interval = 60 ,
188
190
attributes = ['ghi' , 'wind_speed' ],
189
- map_variables = True )
191
+ leap_day = False , map_variables = True )
190
192
assert 'ghi' in data .columns
191
193
assert 'wind_speed' in data .columns
192
194
assert 'latitude' in meta .keys ()
@@ -199,3 +201,14 @@ def test_get_psm3_attribute_mapping(nrel_api_key):
199
201
def test_psm3_variable_map_deprecation_warning (nrel_api_key ):
200
202
with pytest .warns (pvlibDeprecationWarning , match = 'names will be renamed' ):
201
203
_ = psm3 .read_psm3 (MANUAL_TEST_DATA )
204
+
205
+
206
+ @pytest .mark .remote_data
207
+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
208
+ def test_psm3_leap_day_deprecation_warning (nrel_api_key ):
209
+ with pytest .warns (pvlibDeprecationWarning ,
210
+ match = 'default to leap_day=True' ):
211
+ _ , _ = psm3 .get_psm3 (LATITUDE , LONGITUDE , nrel_api_key , PVLIB_EMAIL ,
212
+ names = 2019 , interval = 60 ,
213
+ attributes = ['ghi' , 'wind_speed' ],
214
+ map_variables = True )
0 commit comments