Skip to content

Commit cbadd89

Browse files
committed
rename I to current
1 parent 9710b01 commit cbadd89

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

pvlib/singlediode.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,9 @@ def _pwr_optfcn(df, loc):
675675
Function to find power from ``i_from_v``.
676676
'''
677677

678-
I = _lambertw_i_from_v(df[loc], df['photocurrent'],
679-
df['saturation_current'], df['resistance_series'],
680-
df['resistance_shunt'], df['nNsVth'])
678+
current = _lambertw_i_from_v(df[loc], df['photocurrent'],
679+
df['saturation_current'],
680+
df['resistance_series'],
681+
df['resistance_shunt'], df['nNsVth'])
681682

682-
return I * df[loc]
683+
return current * df[loc]

pvlib/tests/test_pvsystem.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ def test_i_from_v_from_i(fixture_v_from_i):
10931093
Rsh = fixture_v_from_i['Rsh']
10941094
Rs = fixture_v_from_i['Rs']
10951095
nNsVth = fixture_v_from_i['nNsVth']
1096-
I = fixture_v_from_i['I']
1096+
current = fixture_v_from_i['I']
10971097
I0 = fixture_v_from_i['I0']
10981098
IL = fixture_v_from_i['IL']
10991099
V = fixture_v_from_i['V_expected']
@@ -1103,15 +1103,15 @@ def test_i_from_v_from_i(fixture_v_from_i):
11031103

11041104
I_expected = pvsystem.i_from_v(V, IL, I0, Rs, Rsh, nNsVth,
11051105
method='lambertw')
1106-
assert_allclose(I, I_expected, atol=atol)
1106+
assert_allclose(current, I_expected, atol=atol)
11071107

1108-
I = pvsystem.i_from_v(V, IL, I0, Rs, Rsh, nNsVth)
1108+
current = pvsystem.i_from_v(V, IL, I0, Rs, Rsh, nNsVth)
11091109

1110-
assert isinstance(I, type(I_expected))
1111-
if isinstance(I, np.ndarray):
1112-
assert isinstance(I.dtype, type(I_expected.dtype))
1113-
assert I.shape == I_expected.shape
1114-
assert_allclose(I, I_expected, atol=atol)
1110+
assert isinstance(current, type(I_expected))
1111+
if isinstance(current, np.ndarray):
1112+
assert isinstance(current.dtype, type(I_expected.dtype))
1113+
assert current.shape == I_expected.shape
1114+
assert_allclose(current, I_expected, atol=atol)
11151115

11161116

11171117
@pytest.fixture(params=[
@@ -1200,13 +1200,13 @@ def test_i_from_v(fixture_i_from_v, method, atol):
12001200
IL = fixture_i_from_v['IL']
12011201
I_expected = fixture_i_from_v['I_expected']
12021202

1203-
I = pvsystem.i_from_v(V, IL, I0, Rs, Rsh, nNsVth, method=method)
1203+
current = pvsystem.i_from_v(V, IL, I0, Rs, Rsh, nNsVth, method=method)
12041204

1205-
assert isinstance(I, type(I_expected))
1206-
if isinstance(I, np.ndarray):
1207-
assert isinstance(I.dtype, type(I_expected.dtype))
1208-
assert I.shape == I_expected.shape
1209-
assert_allclose(I, I_expected, atol=atol)
1205+
assert isinstance(current, type(I_expected))
1206+
if isinstance(current, np.ndarray):
1207+
assert isinstance(current.dtype, type(I_expected.dtype))
1208+
assert current.shape == I_expected.shape
1209+
assert_allclose(current, I_expected, atol=atol)
12101210

12111211

12121212
def test_PVSystem_i_from_v(mocker):

0 commit comments

Comments
 (0)