Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ Bug fixes
* Fix floating point round-off issue in
:py:func:`~pvlib.irradiance.aoi_projection` (:issue:`1185`, :pull:`1191`)
* Update GFS product names for GFS v16. (:issue:`1202`, :pull:`1203`)
* Take into account ``EgRef``, ``dEgdT``, ``irrad_ref`` and ``temp_ref`` when
calling :py:func:`~pvlib.pvsystem.calcparams_cec`. (:issue:`1215`, :pull:`1216`)
* Corrected methodology error in :py:func:`~pvlib.scaling.wvm`. Tracks with
fix in PVLib for MATLAB. (:issue:`1206`, :pull:`1213`)

Expand Down Expand Up @@ -197,5 +199,6 @@ Contributors
* Joshua Stein (:ghuser:`jsstein`)
* Tony Lorenzo (:ghuser:`alorenzo175`)
* Damjan Postolovski (:ghuser:`dpostolovski`)
* Miguel Sánchez de León Peque (:ghuser:`Peque`)
* Joe Ranalli (:ghuser:`jranalli`)
* Chas Schweizer (:ghuser:`cpr-chas`)
4 changes: 2 additions & 2 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1994,8 +1994,8 @@ def calcparams_cec(effective_irradiance, temp_cell,
alpha_sc*(1.0 - Adjust/100),
a_ref, I_L_ref, I_o_ref,
R_sh_ref, R_s,
EgRef=1.121, dEgdT=-0.0002677,
irrad_ref=1000, temp_ref=25)
EgRef=EgRef, dEgdT=dEgdT,
irrad_ref=irrad_ref, temp_ref=temp_ref)


def calcparams_pvsyst(effective_irradiance, temp_cell,
Expand Down
37 changes: 37 additions & 0 deletions pvlib/tests/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,43 @@ def test_calcparams_cec(cec_module_params):
check_less_precise=3)


def test_calcparams_cec_extra_params_propagation(cec_module_params, mocker):
"""
See bug #1215.

When calling `calcparams_cec`, the parameters `EgRef`, `dEgdT`, `irrad_ref`
and `temp_ref` must not be ignored.

Since, internally, this function is calling `calcparams_desoto`, this test
checks that the latter is called with the expected parameters instead of
some default values.
"""
times = pd.date_range(start='2015-01-01', periods=3, freq='12H')
effective_irradiance = pd.Series([0.0, 800.0, 800.0], index=times)
temp_cell = pd.Series([25, 25, 50], index=times)
extra_parameters = dict(
EgRef=1.123,
dEgdT=-0.0002688,
irrad_ref=1100,
temp_ref=23,
)
m = mocker.spy(pvsystem, 'calcparams_desoto')
pvsystem.calcparams_cec(
effective_irradiance=effective_irradiance,
temp_cell=temp_cell,
alpha_sc=cec_module_params['alpha_sc'],
a_ref=cec_module_params['a_ref'],
I_L_ref=cec_module_params['I_L_ref'],
I_o_ref=cec_module_params['I_o_ref'],
R_sh_ref=cec_module_params['R_sh_ref'],
R_s=cec_module_params['R_s'],
Adjust=cec_module_params['Adjust'],
**extra_parameters,
)
assert m.call_count == 1
assert m.call_args[1] == extra_parameters


def test_calcparams_pvsyst(pvsyst_module_params):
times = pd.date_range(start='2015-01-01', periods=2, freq='12H')
effective_irradiance = pd.Series([0.0, 800.0], index=times)
Expand Down