@@ -792,6 +792,43 @@ def test_calcparams_cec(cec_module_params):
792792 check_less_precise = 3 )
793793
794794
795+ def test_calcparams_cec_extra_params_propagation (cec_module_params , mocker ):
796+ """
797+ See bug #1215.
798+
799+ When calling `calcparams_cec`, the parameters `EgRef`, `dEgdT`, `irrad_ref`
800+ and `temp_ref` must not be ignored.
801+
802+ Since, internally, this function is calling `calcparams_desoto`, this test
803+ checks that the latter is called with the expected parameters instead of
804+ some default values.
805+ """
806+ times = pd .date_range (start = '2015-01-01' , periods = 3 , freq = '12H' )
807+ effective_irradiance = pd .Series ([0.0 , 800.0 , 800.0 ], index = times )
808+ temp_cell = pd .Series ([25 , 25 , 50 ], index = times )
809+ extra_parameters = dict (
810+ EgRef = 1.123 ,
811+ dEgdT = - 0.0002688 ,
812+ irrad_ref = 1100 ,
813+ temp_ref = 23 ,
814+ )
815+ m = mocker .spy (pvsystem , 'calcparams_desoto' )
816+ pvsystem .calcparams_cec (
817+ effective_irradiance = effective_irradiance ,
818+ temp_cell = temp_cell ,
819+ alpha_sc = cec_module_params ['alpha_sc' ],
820+ a_ref = cec_module_params ['a_ref' ],
821+ I_L_ref = cec_module_params ['I_L_ref' ],
822+ I_o_ref = cec_module_params ['I_o_ref' ],
823+ R_sh_ref = cec_module_params ['R_sh_ref' ],
824+ R_s = cec_module_params ['R_s' ],
825+ Adjust = cec_module_params ['Adjust' ],
826+ ** extra_parameters ,
827+ )
828+ assert m .call_count == 1
829+ assert m .call_args [1 ] == extra_parameters
830+
831+
795832def test_calcparams_pvsyst (pvsyst_module_params ):
796833 times = pd .date_range (start = '2015-01-01' , periods = 2 , freq = '12H' )
797834 effective_irradiance = pd .Series ([0.0 , 800.0 ], index = times )
0 commit comments