Skip to content

Commit 66a801d

Browse files
committed
TST: update singlediode test for updated atol in pvlib#415
* use `method='lambertw'` for singlediode tests * update arguments for calcparams_desoto everywhere with effective_irradiance and expand model parameters a_ref, I_L_ref, I_o_ref, R_sh_ref, and R_s
1 parent 5c939b8 commit 66a801d

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

pvlib/test/test_pvsystem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def test_singlediode_array():
797797
def test_singlediode_floats(sam_data):
798798
module = 'Example_Module'
799799
module_parameters = sam_data['cecmod'][module]
800-
out = pvsystem.singlediode(7, 6e-7, .1, 20, .5)
800+
out = pvsystem.singlediode(7, 6e-7, .1, 20, .5, method='lambertw')
801801
expected = {'i_xx': 4.2498,
802802
'i_mp': 6.1275,
803803
'v_oc': 8.1063,
@@ -817,7 +817,7 @@ def test_singlediode_floats(sam_data):
817817

818818
@requires_scipy
819819
def test_singlediode_floats_ivcurve():
820-
out = pvsystem.singlediode(7, 6e-7, .1, 20, .5, ivcurve_pnts=3)
820+
out = pvsystem.singlediode(7, 6e-7, .1, 20, .5, ivcurve_pnts=3, method='lambertw')
821821
expected = {'i_xx': 4.2498,
822822
'i_mp': 6.1275,
823823
'v_oc': 8.1063,

pvlib/test/test_singlediode_methods.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
def test_fast_spr_e20_327():
2525
spr_e20_327 = CECMOD.SunPower_SPR_E20_327
2626
x = pvsystem.calcparams_desoto(
27-
poa_global=POA, temp_cell=TCELL,
28-
alpha_isc=spr_e20_327.alpha_sc, module_parameters=spr_e20_327,
27+
effective_irradiance=POA, temp_cell=TCELL,
28+
alpha_sc=spr_e20_327.alpha_sc, a_ref=spr_e20_327.a_ref,
29+
I_L_ref=spr_e20_327.I_L_ref, I_o_ref=spr_e20_327.I_o_ref,
30+
R_sh_ref=spr_e20_327.R_sh_ref, R_s=spr_e20_327.R_s,
2931
EgRef=1.121, dEgdT=-0.0002677)
3032
il, io, rs, rsh, nnsvt = x
3133
tstart = clock()
@@ -59,8 +61,9 @@ def test_fast_spr_e20_327():
5961
def test_fast_fs_495():
6062
fs_495 = CECMOD.First_Solar_FS_495
6163
x = pvsystem.calcparams_desoto(
62-
poa_global=POA, temp_cell=TCELL,
63-
alpha_isc=fs_495.alpha_sc, module_parameters=fs_495,
64+
effective_irradiance=POA, temp_cell=TCELL,
65+
alpha_sc=fs_495.alpha_sc, a_ref=fs_495.a_ref, I_L_ref=fs_495.I_L_ref,
66+
I_o_ref=fs_495.I_o_ref, R_sh_ref=fs_495.R_sh_ref, R_s=fs_495.R_s,
6467
EgRef=1.475, dEgdT=-0.0003)
6568
il, io, rs, rsh, nnsvt = x
6669
x += (101, )
@@ -95,8 +98,10 @@ def test_fast_fs_495():
9598
def test_slow_spr_e20_327():
9699
spr_e20_327 = CECMOD.SunPower_SPR_E20_327
97100
x = pvsystem.calcparams_desoto(
98-
poa_global=POA, temp_cell=TCELL,
99-
alpha_isc=spr_e20_327.alpha_sc, module_parameters=spr_e20_327,
101+
effective_irradiance=POA, temp_cell=TCELL,
102+
alpha_sc=spr_e20_327.alpha_sc, a_ref=spr_e20_327.a_ref,
103+
I_L_ref=spr_e20_327.I_L_ref, I_o_ref=spr_e20_327.I_o_ref,
104+
R_sh_ref=spr_e20_327.R_sh_ref, R_s=spr_e20_327.R_s,
100105
EgRef=1.121, dEgdT=-0.0002677)
101106
il, io, rs, rsh, nnsvt = x
102107
tstart = clock()
@@ -130,8 +135,9 @@ def test_slow_spr_e20_327():
130135
def test_slow_fs_495():
131136
fs_495 = CECMOD.First_Solar_FS_495
132137
x = pvsystem.calcparams_desoto(
133-
poa_global=POA, temp_cell=TCELL,
134-
alpha_isc=fs_495.alpha_sc, module_parameters=fs_495,
138+
effective_irradiance=POA, temp_cell=TCELL,
139+
alpha_sc=fs_495.alpha_sc, a_ref=fs_495.a_ref, I_L_ref=fs_495.I_L_ref,
140+
I_o_ref=fs_495.I_o_ref, R_sh_ref=fs_495.R_sh_ref, R_s=fs_495.R_s,
135141
EgRef=1.475, dEgdT=-0.0003)
136142
il, io, rs, rsh, nnsvt = x
137143
x += (101, )

0 commit comments

Comments
 (0)