Skip to content

Commit 6a69804

Browse files
committed
get fslr correction to 100% coverage
1 parent 91ada54 commit 6a69804

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

pvlib/tests/test_spectrum.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,23 @@ def test_first_solar_spectral_correction_ambiguous():
216216
spectrum.first_solar_spectral_correction(1, 1)
217217

218218

219+
def test_first_solar_spectral_correction_ambiguous_both():
220+
# use the cdte coeffs
221+
coeffs = (0.87102, -0.040543, -0.00929202, 0.10052, 0.073062, -0.0034187)
222+
with pytest.raises(TypeError):
223+
spectrum.first_solar_spectral_correction(1, 1, 'cdte',
224+
coefficients=coeffs)
225+
226+
def test_first_solar_spectral_correction_large_airmass():
227+
# test that airmass > 10 is treated same as airmass==10
228+
m_eq10 = spectrum.first_solar_spectral_correction(1, 10, 'monosi')
229+
m_gt10 = spectrum.first_solar_spectral_correction(1, 15, 'monosi')
230+
assert_allclose(m_eq10, m_gt10)
231+
232+
def test_first_solar_spectral_correction_low_airmass():
233+
with pytest.warns(UserWarning, match='Exceptionally low air mass'):
234+
_ = spectrum.first_solar_spectral_correction(1, 0.1, 'monosi')
235+
219236
def test_first_solar_spectral_correction_range():
220237
with pytest.warns(UserWarning, match='Exceptionally high pw values'):
221238
out = spectrum.first_solar_spectral_correction(np.array([.1, 3, 10]),

0 commit comments

Comments
 (0)