1414)
1515from .conftest import RERUNS , RERUNS_DELAY
1616
17+ from pvlib ._deprecation import pvlibDeprecationWarning
18+
1719pytestmark = pytest .mark .skipif (not has_siphon , reason = 'requires siphon' )
1820
1921
5254@requires_siphon
5355@pytest .fixture (scope = 'module' , params = _modelclasses )
5456def model (request ):
55- amodel = request .param ()
57+ with pytest .warns (pvlibDeprecationWarning ):
58+ amodel = request .param ()
5659 try :
5760 raw_data = amodel .get_data (_latitude , _longitude , _start , _end )
5861 except Exception as e :
@@ -90,7 +93,8 @@ def test_process_data(model):
9093def test_bad_kwarg_get_data ():
9194 # For more information on why you would want to pass an unknown keyword
9295 # argument, see Github issue #745.
93- amodel = NAM ()
96+ with pytest .warns (pvlibDeprecationWarning ):
97+ amodel = NAM ()
9498 data = amodel .get_data (_latitude , _longitude , _start , _end ,
9599 bad_kwarg = False )
96100 assert not data .empty
@@ -103,7 +107,8 @@ def test_bad_kwarg_get_data():
103107def test_bad_kwarg_get_processed_data ():
104108 # For more information on why you would want to pass an unknown keyword
105109 # argument, see Github issue #745.
106- amodel = NAM ()
110+ with pytest .warns (pvlibDeprecationWarning ):
111+ amodel = NAM ()
107112 data = amodel .get_processed_data (_latitude , _longitude , _start , _end ,
108113 bad_kwarg = False )
109114 assert not data .empty
@@ -114,7 +119,8 @@ def test_bad_kwarg_get_processed_data():
114119@pytest .mark .remote_data
115120@pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
116121def test_how_kwarg_get_processed_data ():
117- amodel = NAM ()
122+ with pytest .warns (pvlibDeprecationWarning ):
123+ amodel = NAM ()
118124 data = amodel .get_processed_data (_latitude , _longitude , _start , _end ,
119125 how = 'clearsky_scaling' )
120126 assert not data .empty
@@ -125,7 +131,8 @@ def test_how_kwarg_get_processed_data():
125131@pytest .mark .remote_data
126132@pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
127133def test_vert_level ():
128- amodel = NAM ()
134+ with pytest .warns (pvlibDeprecationWarning ):
135+ amodel = NAM ()
129136 vert_level = 5000
130137 amodel .get_processed_data (_latitude , _longitude , _start , _end ,
131138 vert_level = vert_level )
@@ -136,7 +143,8 @@ def test_vert_level():
136143@pytest .mark .remote_data
137144@pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
138145def test_datetime ():
139- amodel = NAM ()
146+ with pytest .warns (pvlibDeprecationWarning ):
147+ amodel = NAM ()
140148 start = datetime .now (tz = timezone .utc )
141149 end = start + timedelta (days = 1 )
142150 amodel .get_processed_data (_latitude , _longitude , start , end )
@@ -147,7 +155,8 @@ def test_datetime():
147155@pytest .mark .remote_data
148156@pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
149157def test_queryvariables ():
150- amodel = GFS ()
158+ with pytest .warns (pvlibDeprecationWarning ):
159+ amodel = GFS ()
151160 new_variables = ['u-component_of_wind_height_above_ground' ]
152161 data = amodel .get_data (_latitude , _longitude , _start , _end ,
153162 query_variables = new_variables )
@@ -156,16 +165,19 @@ def test_queryvariables():
156165
157166@requires_siphon
158167def test_latest ():
159- GFS (set_type = 'latest' )
168+ with pytest .warns (pvlibDeprecationWarning ):
169+ GFS (set_type = 'latest' )
160170
161171
162172@requires_siphon
163173def test_full ():
164- GFS (set_type = 'full' )
174+ with pytest .warns (pvlibDeprecationWarning ):
175+ GFS (set_type = 'full' )
165176
166177
167178def test_temp_convert ():
168- amodel = GFS ()
179+ with pytest .warns (pvlibDeprecationWarning ):
180+ amodel = GFS ()
169181 data = pd .DataFrame ({'temp_air' : [273.15 ]})
170182 data ['temp_air' ] = amodel .kelvin_to_celsius (data ['temp_air' ])
171183
@@ -183,27 +195,31 @@ def test_temp_convert():
183195
184196
185197def test_set_location ():
186- amodel = GFS ()
198+ with pytest .warns (pvlibDeprecationWarning ):
199+ amodel = GFS ()
187200 latitude , longitude = 32.2 , - 110.9
188201 time = 'UTC'
189202 amodel .set_location (time , latitude , longitude )
190203
191204
192205def test_set_query_time_range_tzfail ():
193- amodel = GFS ()
206+ with pytest .warns (pvlibDeprecationWarning ):
207+ amodel = GFS ()
194208 with pytest .raises (TypeError ):
195209 amodel .set_query_time_range (datetime .now (), datetime .now ())
196210
197211
198212def test_cloud_cover_to_transmittance_linear ():
199- amodel = GFS ()
213+ with pytest .warns (pvlibDeprecationWarning ):
214+ amodel = GFS ()
200215 assert_allclose (amodel .cloud_cover_to_transmittance_linear (0 ), 0.75 )
201216 assert_allclose (amodel .cloud_cover_to_transmittance_linear (100 ), 0.0 )
202217 assert_allclose (amodel .cloud_cover_to_transmittance_linear (0 , 0.5 ), 0.5 )
203218
204219
205220def test_cloud_cover_to_ghi_linear ():
206- amodel = GFS ()
221+ with pytest .warns (pvlibDeprecationWarning ):
222+ amodel = GFS ()
207223 ghi_clear = 1000
208224 offset = 25
209225 out = amodel .cloud_cover_to_ghi_linear (0 , ghi_clear , offset = offset )
0 commit comments