Repository navigation
Description
The temperature_model_parameters handling code below suggests to me that in 0.8 we're going to
- set default values
module_type=Noneandracking_model=None. - require user to specify either
temperature_model_parametersor bothmodule_typeandracking_model.
pvlib-python/pvlib/pvsystem.py
Lines 208 to 221 in 27872b8
| # TODO: deprecated behavior if PVSystem.temperature_model_parameters | |
| # are not specified. Remove in v0.8 | |
| if not any(self.temperature_model_parameters): | |
| warnings.warn( | |
| 'Required temperature_model_parameters is not specified ' | |
| 'and parameters are not inferred from racking_model and ' | |
| 'module_type. Reverting to deprecated default: SAPM cell ' | |
| 'temperature model parameters for a glass/glass module in ' | |
| 'open racking. In the future ' | |
| 'PVSystem.temperature_model_parameters will be required', | |
| pvlibDeprecationWarning) | |
| params = temperature._temperature_model_params( | |
| 'sapm', 'open_rack_glass_glass') | |
| self.temperature_model_parameters = params |
@cwhanse is that correct?
The problem is that the only way to see this warning is to supply an invalid module_type or racking_model. That's because PVSystem._infer_temperature_model is called before the code above, and it looks up the default module_type and racking_model and successfully finds temperature coefficients.
pvlib-python/pvlib/pvsystem.py
Lines 201 to 203 in 27872b8
| if temperature_model_parameters is None: | |
| self.temperature_model_parameters = \ | |
| self._infer_temperature_model_params() |
So I'm guessing that this warning has been seen by only a small fraction of people that need to see it. I'm ok moving forward with the removal in 0.8 or pushing to 0.9.
Activity
cwhanse commentedon Aug 25, 2020
Yes, that is the intent.
The warning should have been raised whenever condition #2 above wasn't met; it looks to me that has been the case. If that hasn't been the case I would prefer to fix the warning and push the deprecation out to v0.9. pvlib-python has had that unadvertised default temperature model assignment for a long time.
cwhanse commentedon Aug 25, 2020
I don't follow here - it looks to me that the warning should be raised if 1)
temperature_model_parametersisn't specified, or 2) eithermodule_typeorracking_modelare invalid. Maybe we're saying the same thing._infer_temperature_modeldoesn't assign the default temperature model, that is done in the block of code that raises the warning.wholmgren commentedon Aug 25, 2020
The
module_typeandracking_modeldefaults prevent the warning from showing up in many use cases. If we change the defaults toNonethen the warning will be triggered. If we simultaneously remove the warning then code will break without users having ever seen the warning.wholmgren commentedon Aug 25, 2020
What is the expected behavior for
PVSystem()?cwhanse commentedon Aug 25, 2020
Aha. I see the problem now, thanks. Perhaps remove the defaults in v0.8 and leave the warning until v0.9?
wholmgren commentedon Aug 25, 2020
Ok, I'll work on that.