Skip to content

Commit 7ac643f

Browse files
committed
pacify flake8
1 parent 9b60d2e commit 7ac643f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pvlib/singlediode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -859,25 +859,25 @@ def _lambertw_i_from_v(voltage, photocurrent, saturation_current,
859859
# Explicit solutions where Rs=0
860860
if np.any(idx_z):
861861
I[idx_z] = IL[idx_z] - I0[idx_z] * np.expm1(V[idx_z] / a[idx_z]) - \
862-
Gsh[idx_z] * V[idx_z]
862+
Gsh[idx_z] * V[idx_z]
863863

864864
# Only compute using LambertW if there are cases with Rs>0
865865
# Does NOT handle possibility of overflow, github issue 298
866866
if np.any(idx_p):
867867
# LambertW argument, cannot be float128, may overflow to np.inf
868868
argW = Rs[idx_p] * I0[idx_p] / (
869-
a[idx_p] * (Rs[idx_p] * Gsh[idx_p] + 1.)) * \
870-
np.exp((Rs[idx_p] * (IL[idx_p] + I0[idx_p]) + V[idx_p]) /
871-
(a[idx_p] * (Rs[idx_p] * Gsh[idx_p] + 1.)))
869+
a[idx_p] * (Rs[idx_p] * Gsh[idx_p] + 1.)) * (
870+
np.exp((Rs[idx_p] * (IL[idx_p] + I0[idx_p]) + V[idx_p])
871+
/ (a[idx_p] * (Rs[idx_p] * Gsh[idx_p] + 1.))))
872872

873873
lambertwterm = _lambertw_pvlib(argW)
874874

875875
# Eqn. 2 in Jain and Kapoor, 2004
876876
# I = -V/(Rs + Rsh) - (a/Rs)*lambertwterm + Rsh*(IL + I0)/(Rs + Rsh)
877877
# Recast in terms of Gsh=1/Rsh for better numerical stability.
878878
I[idx_p] = (IL[idx_p] + I0[idx_p] - V[idx_p] * Gsh[idx_p]) / \
879-
(Rs[idx_p] * Gsh[idx_p] + 1.) - (
880-
a[idx_p] / Rs[idx_p]) * lambertwterm
879+
(Rs[idx_p] * Gsh[idx_p] + 1.) \
880+
- (a[idx_p] / Rs[idx_p]) * lambertwterm
881881

882882
if output_is_scalar:
883883
return I.item()

0 commit comments

Comments
 (0)