-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix crash in ModelChain.infer_spectral_model due to incorrect method call (2) #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,19 @@ def cec_dc_snl_ac_system(sam_data): | |
| return system | ||
|
|
||
|
|
||
| @pytest.fixture | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. F811 redefinition of unused 'sam_data' from line 22 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. F811 redefinition of unused 'sam_data' from line 22 |
||
| def cec_dc_native_snl_ac_system(sam_data): | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E501 line too long (80 > 79 characters)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as lines 32, 49... (which I copied). Should I change ?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way you may be interested by black to definitively get rid of formatting problems.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fine with me to leave this because I'd like to refactor all of these fixtures. Thanks for the tip. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E501 line too long (80 > 79 characters) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E501 line too long (80 > 79 characters) |
||
| system = PVSystem(surface_tilt=32.2, surface_azimuth=180, | ||
| module=module, | ||
| module_parameters=module_parameters, | ||
| inverter_parameters=inverter) | ||
| return system | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def pvsyst_dc_snl_ac_system(sam_data, pvsyst_module_params): | ||
| module = 'PVsyst test module' | ||
|
|
@@ -251,6 +264,21 @@ def test_infer_dc_model(system, cec_dc_snl_ac_system, pvsyst_dc_snl_ac_system, | |
| assert isinstance(mc.dc, (pd.Series, pd.DataFrame)) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize('dc_model', [ | ||
| 'sapm', | ||
| pytest.param('cec', marks=requires_scipy), | ||
| pytest.param('cec_native', marks=requires_scipy)]) | ||
| def test_infer_spectral_model(location, system, cec_dc_snl_ac_system, | ||
| cec_dc_native_snl_ac_system, dc_model): | ||
| dc_systems = {'sapm': system, | ||
| 'cec': cec_dc_snl_ac_system, | ||
| 'cec_native': cec_dc_native_snl_ac_system} | ||
| system = dc_systems[dc_model] | ||
| mc = ModelChain(system, location, | ||
| orientation_strategy='None', aoi_model='physical') | ||
| assert isinstance(mc, ModelChain) | ||
|
|
||
|
|
||
| def test_dc_model_user_func(pvwatts_dc_pvwatts_ac_system, location, weather, | ||
| mocker): | ||
| m = mocker.spy(sys.modules[__name__], 'poadc') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F811 redefinition of unused 'sam_data' from line 22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as lines 26, 40... I think this is a linter error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree