Skip to content

Commit 652a3ba

Browse files
authored
Handle kwargs for ModelChain.noct_sam_celltemp (#1198)
* fix kwargs in ModelChain._set_celltemp, add to test * change to kwargs in mocker.spy * try this * test fix
1 parent f7f9dbb commit 652a3ba

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pvlib/modelchain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,11 +998,11 @@ def _set_celltemp(self, model):
998998
self.results.effective_irradiance)
999999
temp_air = _tuple_from_dfs(self.weather, 'temp_air')
10001000
wind_speed = _tuple_from_dfs(self.weather, 'wind_speed')
1001-
arg_list = [poa, temp_air, wind_speed]
10021001
kwargs = {}
10031002
if model == self.system.noct_sam_celltemp:
10041003
kwargs['effective_irradiance'] = self.results.effective_irradiance
1005-
self.results.cell_temperature = model(*tuple(arg_list))
1004+
self.results.cell_temperature = model(poa, temp_air, wind_speed,
1005+
**kwargs)
10061006
return self
10071007

10081008
def sapm_temp(self):

pvlib/tests/test_modelchain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,9 @@ def test_run_model_with_weather_noct_sam_temp(sapm_dc_snl_ac_system, location,
719719
assert m_noct_sam.call_count == 1
720720
assert_series_equal(m_noct_sam.call_args[0][1], weather['temp_air'])
721721
assert_series_equal(m_noct_sam.call_args[0][2], weather['wind_speed'])
722-
assert not mc.results.ac.empty
722+
# check that effective_irradiance was used
723+
assert m_noct_sam.call_args[1] == {
724+
'effective_irradiance': mc.results.effective_irradiance}
723725

724726

725727
def test_run_model_tracker(sapm_dc_snl_ac_system, location, weather, mocker):

0 commit comments

Comments
 (0)