88from pvlib import pvsystem
99from pvlib .singlediode import (bishop88_mpp , estimate_voc , VOLTAGE_BUILTIN ,
1010 bishop88 , bishop88_i_from_v , bishop88_v_from_i ,
11- batzelis_keypoints )
11+ batzelis )
1212import pytest
1313from numpy .testing import assert_array_equal
1414from .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