Skip to content

Commit 7511558

Browse files
committed
avoid warning
1 parent 16bd076 commit 7511558

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pvlib/singlediode.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,10 +802,12 @@ def _lambertw_v_from_i(current, photocurrent, saturation_current,
802802
with np.errstate(over='ignore'):
803803
argW = I0 / (Gsh * a) * np.exp((-I + IL + I0) / (Gsh * a))
804804

805+
lambertwterm = np.zeros_like(argW)
806+
805807
# Record indices where lambertw input overflowed
806808
idx_inf = np.isinf(argW)
807809

808-
lambertwterm = _lambertw_pvlib(argW)
810+
lambertwterm[~idx_inf] = _lambertw_pvlib(argW[~idx_inf])
809811

810812
# Only re-compute LambertW if it overflowed
811813
if np.any(idx_inf):

0 commit comments

Comments
 (0)