Skip to content

Commit 4d726b5

Browse files
committed
changes from review
1 parent 006ebb0 commit 4d726b5

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

docs/sphinx/source/reference/pv_modeling/sdm.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Functions relevant for single diode models.
1717
pvsystem.v_from_i
1818
pvsystem.max_power_point
1919
ivtools.sdm.pvsyst_temperature_coeff
20-
singlediode.batzelis_keypoints
20+
singlediode.batzelis
2121

2222
Low-level functions for solving the single diode equation.
2323

docs/sphinx/source/whatsnew/v0.13.2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Enhancements
2020
~~~~~~~~~~~~
2121
* Add :py:func:`~pvlib.ivtools.sdm.fit_desoto_batzelis`, a function to estimate
2222
parameters for the De Soto single-diode model from datasheet values. (:pull:`2563`)
23-
* Add :py:func:`~pvlib.singlediode.batzelis_keypoints`, a function to estimate
23+
* Add :py:func:`~pvlib.singlediode.batzelis`, a function to estimate
2424
maximum power, open circuit, and short circuit points using parameters for
2525
the single-diode equation. (:pull:`2563`)
2626
* Add :py:func:`~pvlib.pvarray.batzelis`, a function to estimate maximum power

pvlib/singlediode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,8 @@ def _pwr_optfcn(df, loc):
952952
return current * df[loc]
953953

954954

955-
def batzelis_keypoints(photocurrent, saturation_current, resistance_series,
956-
resistance_shunt, nNsVth):
955+
def batzelis(photocurrent, saturation_current, resistance_series,
956+
resistance_shunt, nNsVth):
957957
"""
958958
Estimate maximum power, open-circuit, and short-circuit points from
959959
single-diode equation parameters using Batzelis's method.

tests/test_singlediode.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pvlib import pvsystem
99
from pvlib.singlediode import (bishop88_mpp, estimate_voc, VOLTAGE_BUILTIN,
1010
bishop88, bishop88_i_from_v, bishop88_v_from_i,
11-
batzelis_keypoints)
11+
batzelis)
1212
import pytest
1313
from numpy.testing import assert_array_equal
1414
from .conftest import TESTS_DATA_DIR
@@ -626,7 +626,7 @@ def test_bishop88_init_cond(method):
626626
assert not bad_results.any()
627627

628628

629-
def test_batzelis_keypoints():
629+
def test_batzelis():
630630
params = {'photocurrent': 10, 'saturation_current': 1e-10,
631631
'resistance_series': 0.2, 'resistance_shunt': 3000,
632632
'nNsVth': 1.7}
@@ -640,37 +640,38 @@ def test_batzelis_keypoints():
640640
}
641641
rtol = 5e-3 # accurate to within half a percent in this case
642642

643-
output = batzelis_keypoints(**params)
643+
output = batzelis(**params)
644644
for key in exact_values:
645645
assert output[key] == pytest.approx(exact_values[key], rel=rtol)
646646

647647
# numpy arrays
648648
params2 = {k: np.array([v] * 2) for k, v in params.items()}
649-
output2 = batzelis_keypoints(**params2)
649+
output2 = batzelis(**params2)
650650
for key in exact_values:
651651
exp = np.array([exact_values[key]] * 2)
652652
np.testing.assert_allclose(output2[key], exp, rtol=rtol)
653653

654654
# pandas
655655
params3 = {k: pd.Series(v) for k, v in params2.items()}
656-
output3 = batzelis_keypoints(**params3)
656+
output3 = batzelis(**params3)
657657
assert isinstance(output3, pd.DataFrame)
658658
for key in exact_values:
659659
exp = pd.Series([exact_values[key]] * 2)
660660
np.testing.assert_allclose(output3[key], exp, rtol=rtol)
661661

662662

663-
def test_batzelis_keypoints_night():
664-
# SDMs produce photocurrent=0 and resistance_shunt=inf at night
665-
out = batzelis_keypoints(photocurrent=0, saturation_current=1e-10,
666-
resistance_series=0.2, resistance_shunt=np.inf,
667-
nNsVth=1.7)
663+
def test_batzelis_night():
664+
# The De Soto SDM produces photocurrent=0 and resistance_shunt=inf
665+
# at 0 W/m2 irradiance
666+
out = batzelis(photocurrent=0, saturation_current=1e-10,
667+
resistance_series=0.2, resistance_shunt=np.inf,
668+
nNsVth=1.7)
668669
for k, v in out.items():
669670
assert v == 0, k # ensure all outputs are zero (not nan, etc)
670671

671672
# test also when Rsh=inf but Iph > 0
672-
out = batzelis_keypoints(photocurrent=0.1, saturation_current=1e-10,
673-
resistance_series=0.2, resistance_shunt=np.inf,
674-
nNsVth=1.7)
673+
out = batzelis(photocurrent=0.1, saturation_current=1e-10,
674+
resistance_series=0.2, resistance_shunt=np.inf,
675+
nNsVth=1.7)
675676
for k, v in out.items():
676677
assert v > 0, k # ensure all outputs >0 (not nan, etc)

0 commit comments

Comments
 (0)