Skip to content

Commit 8755ecc

Browse files
Add return_components=True path to tests
1 parent ae3b8ff commit 8755ecc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/test_irradiance.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,29 @@ def test_perez_zero_dhi_and_dni(dni_et):
399399
expected = 0.0
400400
assert_equal(out, expected)
401401

402+
out = irradiance.perez(
403+
20, 180, 0.0, 0.0, dni_et, 89.96, 256.28, 37.32, return_components=True
404+
)
405+
expected = {
406+
"poa_sky_diffuse": 0.0,
407+
"poa_isotropic": 0.0,
408+
"poa_circumsolar": 0.0,
409+
"poa_horizon": 0.0,
410+
}
411+
assert len(out) == len(expected)
412+
for key in expected.keys():
413+
assert_equal(out[key], expected[key])
414+
402415

403416
def test_perez_zero_dhi_nonzero_dni(dni_et):
404417
with assert_raises(FloatingPointError):
405418
irradiance.perez(20, 180, 0.0, 100.0, dni_et, 89.96, 256.28, 37.32)
406419

420+
with assert_raises(FloatingPointError):
421+
irradiance.perez(
422+
20, 180, 0.0, 100.0, dni_et, 89.96, 256.28, 37.32, return_components=True
423+
)
424+
407425

408426
def test_perez_arrays(irrad_data, ephem_data, dni_et, relative_airmass):
409427
dni = irrad_data['dni'].copy()

0 commit comments

Comments
 (0)