Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,11 +998,11 @@ def _set_celltemp(self, model):
self.results.effective_irradiance)
temp_air = _tuple_from_dfs(self.weather, 'temp_air')
wind_speed = _tuple_from_dfs(self.weather, 'wind_speed')
arg_list = [poa, temp_air, wind_speed]
kwargs = {}
if model == self.system.noct_sam_celltemp:
kwargs['effective_irradiance'] = self.results.effective_irradiance
self.results.cell_temperature = model(*tuple(arg_list))
self.results.cell_temperature = model(poa, temp_air, wind_speed,
**kwargs)
return self

def sapm_temp(self):
Expand Down
4 changes: 3 additions & 1 deletion pvlib/tests/test_modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,9 @@ def test_run_model_with_weather_noct_sam_temp(sapm_dc_snl_ac_system, location,
assert m_noct_sam.call_count == 1
assert_series_equal(m_noct_sam.call_args[0][1], weather['temp_air'])
assert_series_equal(m_noct_sam.call_args[0][2], weather['wind_speed'])
assert not mc.results.ac.empty
# check that effective_irradiance was used
assert m_noct_sam.call_args.kwargs == {
'effective_irradiance': mc.results.effective_irradiance}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert m_noct_sam.call_args.kwargs == {
'effective_irradiance': mc.results.effective_irradiance}
assert m_noct_sam.call_args[1] == {
'effective_irradiance': mc.results.effective_irradiance}

Copy link
Member

@wholmgren wholmgren Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call_args.kwargs was added in python 3.8, so you have to use the old style look up for the older supported versions. If this doesn't work try

assert_series_equal(m_noct_sam.call_args[1]['effective_irradiance'], mc.results.effective_irradiance)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I was puzzled by the disconnect between pytest docs and the results, didn't think to check versions.



def test_run_model_tracker(sapm_dc_snl_ac_system, location, weather, mocker):
Expand Down