Skip to content

Commit 111ff32

Browse files
committed
Compare function objects in ModelChain._get_cell_temperature()
Rather than using the name of the function we can compare directly to the ModelChain.sapm_temp() bound method to check whether the sapm temperature model is in use.
1 parent dc6b0ec commit 111ff32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pvlib/modelchain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ def _get_cell_temperature(self, data,
14761476
# If module_temperature is in input data we can use the SAPM cell
14771477
# temperature model.
14781478
if (('module_temperature' in data) and
1479-
(self.temperature_model.__name__ == 'sapm_temp')):
1479+
(self.temperature_model is self.sapm_temp)):
14801480
# use SAPM cell temperature model only
14811481
return pvlib.temperature.sapm_cell_from_module(
14821482
module_temperature=data['module_temperature'],

0 commit comments

Comments
 (0)