@@ -807,6 +807,43 @@ def test_calcparams_cec(cec_module_params):
807807 check_less_precise = 3 )
808808
809809
810+ def test_calcparams_cec_extra_params_propagation (cec_module_params , mocker ):
811+ """
812+ See bug #1215.
813+
814+ When calling `calcparams_cec`, the parameters `EgRef`, `dEgdT`, `irrad_ref`
815+ and `temp_ref` must not be ignored.
816+
817+ Since, internally, this function is calling `calcparams_desoto`, this test
818+ checks that the latter is called with the expected parameters instead of
819+ some default values.
820+ """
821+ times = pd .date_range (start = '2015-01-01' , periods = 3 , freq = '12H' )
822+ effective_irradiance = pd .Series ([0.0 , 800.0 , 800.0 ], index = times )
823+ temp_cell = pd .Series ([25 , 25 , 50 ], index = times )
824+ extra_parameters = dict (
825+ EgRef = 1.123 ,
826+ dEgdT = - 0.0002688 ,
827+ irrad_ref = 1100 ,
828+ temp_ref = 23 ,
829+ )
830+ m = mocker .spy (pvsystem , 'calcparams_desoto' )
831+ pvsystem .calcparams_cec (
832+ effective_irradiance = effective_irradiance ,
833+ temp_cell = temp_cell ,
834+ alpha_sc = cec_module_params ['alpha_sc' ],
835+ a_ref = cec_module_params ['a_ref' ],
836+ I_L_ref = cec_module_params ['I_L_ref' ],
837+ I_o_ref = cec_module_params ['I_o_ref' ],
838+ R_sh_ref = cec_module_params ['R_sh_ref' ],
839+ R_s = cec_module_params ['R_s' ],
840+ Adjust = cec_module_params ['Adjust' ],
841+ ** extra_parameters ,
842+ )
843+ assert m .call_count == 1
844+ assert m .call_args .kwargs == extra_parameters
845+
846+
810847def test_calcparams_pvsyst (pvsyst_module_params ):
811848 times = pd .date_range (start = '2015-01-01' , periods = 2 , freq = '12H' )
812849 effective_irradiance = pd .Series ([0.0 , 800.0 ], index = times )
0 commit comments