Skip to content

Commit c9a893a

Browse files
committed
helping test_singlediode pass tests
* in any test where mpp is tested, test lambertw first separately, then use i_from_v to calculate the corresponding value and store it in the expected values *
1 parent 8ee1b94 commit c9a893a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pvlib/test/test_pvsystem.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,13 @@ def test_singlediode_series_ivcurve(cec_module_params):
716716
for k, v in out.items():
717717
assert_allclose(v, expected[k], atol=1e-2)
718718

719-
out = pvsystem.singlediode(IL, I0, Rs, Rsh, nNsVth, ivcurve_pnts=3,
720-
method='lambertw')
719+
out = pvsystem.singlediode(IL, I0, Rs, Rsh, nNsVth, ivcurve_pnts=3)
720+
721+
expected['i_mp'] = pvsystem.i_from_v(Rsh, Rs, nNsVth, out['v_mp'], I0, IL)
722+
expected['v_mp'] = pvsystem.v_from_i(Rsh, Rs, nNsVth, out['i_mp'], I0, IL)
723+
724+
for k, v in out.items():
725+
assert_allclose(v, expected[k], atol=1e-2)
721726

722727

723728
def test_scale_voltage_current_power(sam_data):

0 commit comments

Comments
 (0)