@@ -195,65 +195,64 @@ def test_calc_spectral_mismatch_field(spectrl2_data):
195
195
[ 1.11225204 , 0.93665901 , 0.78487953 ],
196
196
[ 1.14555295 , 0.97084011 , 0.81994083 ]]))
197
197
])
198
- def test_first_solar_spectral_correction (module_type , expect ):
198
+ def test_first_solar (module_type , expect ):
199
199
ams = np .array ([1 , 3 , 5 ])
200
200
pws = np .array ([1 , 3 , 5 ])
201
201
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 )
203
203
assert_allclose (out , expect , atol = 0.001 )
204
204
205
205
206
- def test_first_solar_spectral_correction_supplied ():
206
+ def test_first_solar_supplied ():
207
207
# use the cdte coeffs
208
208
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 )
210
210
expected = 0.99134828
211
211
assert_allclose (out , expected , atol = 1e-3 )
212
212
213
213
214
- def test_first_solar_spectral_correction_ambiguous ():
214
+ def test_first_solar_ambiguous ():
215
215
with pytest .raises (TypeError ):
216
- spectrum .first_solar_spectral_correction (1 , 1 )
216
+ spectrum .first_solar (1 , 1 )
217
217
218
218
219
- def test_first_solar_spectral_correction_ambiguous_both ():
219
+ def test_first_solar_ambiguous_both ():
220
220
# use the cdte coeffs
221
221
coeffs = (0.87102 , - 0.040543 , - 0.00929202 , 0.10052 , 0.073062 , - 0.0034187 )
222
222
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 )
225
224
226
225
227
- def test_first_solar_spectral_correction_large_airmass ():
226
+ def test_first_solar_large_airmass ():
228
227
# 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' )
231
230
assert_allclose (m_eq10 , m_gt10 )
232
231
233
232
234
- def test_first_solar_spectral_correction_low_airmass ():
233
+ def test_first_solar_low_airmass ():
235
234
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' )
237
236
238
237
239
- def test_first_solar_spectral_correction_range ():
238
+ def test_first_solar_range ():
240
239
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 ]),
242
241
np .array ([1 , 3 , 5 ]),
243
242
module_type = 'monosi' )
244
243
expected = np .array ([0.96080878 , 1.03055092 , np .nan ])
245
244
assert_allclose (out , expected , atol = 1e-3 )
246
245
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 ,
248
247
module_type = 'monosi' )
249
248
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 ]),
251
250
np .array ([1 , 3 , 5 ]),
252
251
module_type = 'monosi' )
253
252
expected = np .array ([0.96080878 , 1.03055092 , 1.04932727 ])
254
253
assert_allclose (out , expected , atol = 1e-3 )
255
254
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 ,
257
256
module_type = 'monosi' )
258
257
259
258
@@ -262,9 +261,9 @@ def test_first_solar_spectral_correction_range():
262
261
(np .array ([[10 , np .nan ]]), np .array ([[0.999535 , 0 ]])),
263
262
(pd .Series ([5 ]), pd .Series ([1.0387675 ]))
264
263
])
265
- def test_sapm_spectral_loss (sapm_module_params , airmass , expected ):
264
+ def test_sapm (sapm_module_params , airmass , expected ):
266
265
267
- out = spectrum .sapm_spectral_correction (airmass , sapm_module_params )
266
+ out = spectrum .sapm (airmass , sapm_module_params )
268
267
269
268
if isinstance (airmass , pd .Series ):
270
269
assert_series_equal (out , expected , check_less_precise = 4 )
0 commit comments