Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1759 resolve attrib error model chain #1947
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
1759 resolve attrib error model chain #1947
Changes from 2 commits
6238e51
821d1fc
17e6ee2
5cde61f
00c0b8b
022eabe
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Let's delete this comment as well, since we are now removing the specified
or
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.
Will do about removing the
or
statement, nice catch.Thanks for creating the test. I have 2 comments about it before implementing. The
PVSystem
docstring states:Having stepped away from this and looking at the error I realized that understanding why the temperature model parameter was ignored requires the user to dig through that long
PVsystem
docstring.I think it's worthwhile to update the error message to make it easier on the user:
Also, we need to update that last sentence in the error message, it's confusing. Not sure where this
set()
is coming from, looking for guidance.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.
It's true that passing
temperature_model_parameters
alongsidearrays
is not a valid use for PVSystem. If a user did this, they should not expect it to work. But the intent of this test is to make sure that, when this incorrect usage occurs, the correct error is raised:ValueError: could not infer temperature...
instead ofAttributeError: 'PVSystem' object has no attribute 'racking_model'
. What you suggest (do not specifytemperature_model_parameters
at all) would be a verification of some other behavior, not that the issue from #1759 is resolved.If you like, please clarify the explanation comment in the test for future readers :)
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.
I think I was updating my comment while you were replying. I'm not proposing modifying the test by not specifying
temperature_model_parameters
. I'm proposing updating the error message to make it more informative, as well as fixing the last sentence.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.
Updating that error message is the issue in #1946, right? I think we should fix one thing at a time, and this PR should focus just on #1759.
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.
For this ValueError, what about
"Could not infer the temperature model. If Arrays are not used to construct the PVsystem, check the PVsystem attributes racking_model and module_type. If Arrays are used, check that all Arrays in ModelChain.system.arrays have parameters for the same temperature model. Common temperature model parameters: {params}."
The
params
dict is what ModelChain found when it tries to infer the temperature model, and is provided here to (hopefully) help the user to diagnose and fix the 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.
@kandersolar, you are correct, makes sense, thanks. Will incorporate as per your suggestion and then after we finish probably tackle #1946 to address the error message. Thanks @cwhanse for the phrasing.