@@ -195,65 +195,64 @@ def test_calc_spectral_mismatch_field(spectrl2_data):
195195 [ 1.11225204 , 0.93665901 , 0.78487953 ],
196196 [ 1.14555295 , 0.97084011 , 0.81994083 ]]))
197197])
198- def test_first_solar_spectral_correction (module_type , expect ):
198+ def test_first_solar (module_type , expect ):
199199 ams = np .array ([1 , 3 , 5 ])
200200 pws = np .array ([1 , 3 , 5 ])
201201 ams , pws = np .meshgrid (ams , pws )
202- out = spectrum .first_solar_spectral_correction (pws , ams , module_type )
202+ out = spectrum .first_solar (pws , ams , module_type )
203203 assert_allclose (out , expect , atol = 0.001 )
204204
205205
206- def test_first_solar_spectral_correction_supplied ():
206+ def test_first_solar_supplied ():
207207 # use the cdte coeffs
208208 coeffs = (0.87102 , - 0.040543 , - 0.00929202 , 0.10052 , 0.073062 , - 0.0034187 )
209- out = spectrum .first_solar_spectral_correction (1 , 1 , coefficients = coeffs )
209+ out = spectrum .first_solar (1 , 1 , coefficients = coeffs )
210210 expected = 0.99134828
211211 assert_allclose (out , expected , atol = 1e-3 )
212212
213213
214- def test_first_solar_spectral_correction_ambiguous ():
214+ def test_first_solar_ambiguous ():
215215 with pytest .raises (TypeError ):
216- spectrum .first_solar_spectral_correction (1 , 1 )
216+ spectrum .first_solar (1 , 1 )
217217
218218
219- def test_first_solar_spectral_correction_ambiguous_both ():
219+ def test_first_solar_ambiguous_both ():
220220 # use the cdte coeffs
221221 coeffs = (0.87102 , - 0.040543 , - 0.00929202 , 0.10052 , 0.073062 , - 0.0034187 )
222222 with pytest .raises (TypeError ):
223- spectrum .first_solar_spectral_correction (1 , 1 , 'cdte' ,
224- coefficients = coeffs )
223+ spectrum .first_solar (1 , 1 , 'cdte' , coefficients = coeffs )
225224
226225
227- def test_first_solar_spectral_correction_large_airmass ():
226+ def test_first_solar_large_airmass ():
228227 # test that airmass > 10 is treated same as airmass==10
229- m_eq10 = spectrum .first_solar_spectral_correction (1 , 10 , 'monosi' )
230- m_gt10 = spectrum .first_solar_spectral_correction (1 , 15 , 'monosi' )
228+ m_eq10 = spectrum .first_solar (1 , 10 , 'monosi' )
229+ m_gt10 = spectrum .first_solar (1 , 15 , 'monosi' )
231230 assert_allclose (m_eq10 , m_gt10 )
232231
233232
234- def test_first_solar_spectral_correction_low_airmass ():
233+ def test_first_solar_low_airmass ():
235234 with pytest .warns (UserWarning , match = 'Exceptionally low air mass' ):
236- _ = spectrum .first_solar_spectral_correction (1 , 0.1 , 'monosi' )
235+ _ = spectrum .first_solar (1 , 0.1 , 'monosi' )
237236
238237
239- def test_first_solar_spectral_correction_range ():
238+ def test_first_solar_range ():
240239 with pytest .warns (UserWarning , match = 'Exceptionally high pw values' ):
241- out = spectrum .first_solar_spectral_correction (np .array ([.1 , 3 , 10 ]),
240+ out = spectrum .first_solar (np .array ([.1 , 3 , 10 ]),
242241 np .array ([1 , 3 , 5 ]),
243242 module_type = 'monosi' )
244243 expected = np .array ([0.96080878 , 1.03055092 , np .nan ])
245244 assert_allclose (out , expected , atol = 1e-3 )
246245 with pytest .warns (UserWarning , match = 'Exceptionally high pw values' ):
247- out = spectrum .first_solar_spectral_correction (6 , 1.5 , max_pw = 5 ,
246+ out = spectrum .first_solar (6 , 1.5 , max_pw = 5 ,
248247 module_type = 'monosi' )
249248 with pytest .warns (UserWarning , match = 'Exceptionally low pw values' ):
250- out = spectrum .first_solar_spectral_correction (np .array ([0 , 3 , 8 ]),
249+ out = spectrum .first_solar (np .array ([0 , 3 , 8 ]),
251250 np .array ([1 , 3 , 5 ]),
252251 module_type = 'monosi' )
253252 expected = np .array ([0.96080878 , 1.03055092 , 1.04932727 ])
254253 assert_allclose (out , expected , atol = 1e-3 )
255254 with pytest .warns (UserWarning , match = 'Exceptionally low pw values' ):
256- out = spectrum .first_solar_spectral_correction (0.2 , 1.5 , min_pw = 1 ,
255+ out = spectrum .first_solar (0.2 , 1.5 , min_pw = 1 ,
257256 module_type = 'monosi' )
258257
259258
@@ -262,9 +261,9 @@ def test_first_solar_spectral_correction_range():
262261 (np .array ([[10 , np .nan ]]), np .array ([[0.999535 , 0 ]])),
263262 (pd .Series ([5 ]), pd .Series ([1.0387675 ]))
264263])
265- def test_sapm_spectral_loss (sapm_module_params , airmass , expected ):
264+ def test_sapm (sapm_module_params , airmass , expected ):
266265
267- out = spectrum .sapm_spectral_correction (airmass , sapm_module_params )
266+ out = spectrum .sapm (airmass , sapm_module_params )
268267
269268 if isinstance (airmass , pd .Series ):
270269 assert_series_equal (out , expected , check_less_precise = 4 )
0 commit comments