Fix crash in ModelChain.infer_spectral_model due to incorrect method call (2)#629
Conversation
| return system | ||
|
|
||
|
|
||
| @pytest.fixture |
There was a problem hiding this comment.
F811 redefinition of unused 'sam_data' from line 22
There was a problem hiding this comment.
Same as lines 26, 40... I think this is a linter error.
| module = 'Canadian_Solar_CS5P_220M' | ||
| module_parameters = sam_data['cecmod'][module].copy() | ||
| inverters = sam_data['cecinverter'] | ||
| inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy() |
There was a problem hiding this comment.
E501 line too long (80 > 79 characters)
There was a problem hiding this comment.
Same as lines 32, 49... (which I copied). Should I change ?
There was a problem hiding this comment.
By the way you may be interested by black to definitively get rid of formatting problems.
There was a problem hiding this comment.
Fine with me to leave this because I'd like to refactor all of these fixtures.
Thanks for the tip.
|
Travis error seems strange to me (only for Python3.6) : Lack of "require_scipy" on a test ? Tests pass on my computer under Python3.6.7. |
wholmgren
left a comment
There was a problem hiding this comment.
Looks good, but please add your name and/or username to the Contributors list at the bottom of the whatsnew file.
The test failure is unrelated and can be ignored.
| return system | ||
|
|
||
|
|
||
| @pytest.fixture |
| module = 'Canadian_Solar_CS5P_220M' | ||
| module_parameters = sam_data['cecmod'][module].copy() | ||
| inverters = sam_data['cecinverter'] | ||
| inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy() |
There was a problem hiding this comment.
Fine with me to leave this because I'd like to refactor all of these fixtures.
Thanks for the tip.
| return system | ||
|
|
||
|
|
||
| @pytest.fixture |
There was a problem hiding this comment.
F811 redefinition of unused 'sam_data' from line 22
| module = 'Canadian_Solar_CS5P_220M' | ||
| module_parameters = sam_data['cecmod'][module].copy() | ||
| inverters = sam_data['cecinverter'] | ||
| inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy() |
There was a problem hiding this comment.
E501 line too long (80 > 79 characters)
| 'system.module_parameters. Check that the ' | ||
| 'parameters contain valid ' | ||
| 'first_solar_spectral_coefficients or a valid ' | ||
| 'first_solar_spectral_coefficients and a valid ' |
There was a problem hiding this comment.
I still think this should be or. If Technology or Material is not in params, then attempt to identify the cell type. Or find 'first_solar_spectral_coefficients`.
There was a problem hiding this comment.
I changed the comment because the code says 'and' line 624:
elif ((('Technology' in params or
'Material' in params) and
(pvsystem._infer_cell_type() is not None)) or
(self.system._infer_cell_type() is not None)) or
'first_solar_spectral_coefficients' in params):
There was a problem hiding this comment.
No change to the code, only the comment.
(('Technology' in params or 'Material' in params) and (self.system._infer_cell_type() is not None))
is all one clause, that is OR-ed with the last clause. The and is inside. _infer_cell_type tries to set Technology and Material if those kwargs aren't given.
That compound logic statement could be presented more clearly using multiple lines.
| return system | ||
|
|
||
|
|
||
| @pytest.fixture |
There was a problem hiding this comment.
F811 redefinition of unused 'sam_data' from line 22
| module = 'Canadian_Solar_CS5P_220M' | ||
| module_parameters = sam_data['cecmod'][module].copy() | ||
| inverters = sam_data['cecinverter'] | ||
| inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy() |
There was a problem hiding this comment.
E501 line too long (80 > 79 characters)
|
thanks @jgaffiot ! |
test_model_chain.test_infer_spectral_modelto ensure correct behavior for all reasonable inputs.docs/sphinx/source/api.rstfor API changes.docs/sphinx/source/whatsnewfile for all changes.