-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Resolving AttributeError when using ModelChain with multiple Arrays #1938
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 15 commits
37ddf59
dde73ee
d1b3d80
fa0c606
8bcbaa7
2f4ada3
13a5bc4
8107130
2bafd68
5f2abdf
72bf8f0
196be6a
013b1a2
fd5eb63
fe40f1b
2e02c49
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 | ||||
---|---|---|---|---|---|---|
|
@@ -11,20 +11,26 @@ Enhancements | |||||
|
||||||
Bug fixes | ||||||
~~~~~~~~~ | ||||||
|
||||||
* Fixes `AttributeError: 'PVSystem' object has no attribute 'racking_model'` | ||||||
error in `ModelChain` instantiation when the `temperature_model_parameters` | ||||||
for a `PVSystem` have not been set. Update requires `PVSystem` or `Array` | ||||||
to have `temperature_model_parameters` explicitly or implicitly by providing | ||||||
`racking_model` and `module_type`. | ||||||
|
||||||
Testing | ||||||
~~~~~~~ | ||||||
|
||||||
|
||||||
Documentation | ||||||
~~~~~~~~~~~~~ | ||||||
|
||||||
* Update all examples in :ref:`pvsystem` User's guide page that reference | ||||||
`pvsystem` to adhere to new required argument. | ||||||
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.
Suggested change
|
||||||
|
||||||
Requirements | ||||||
~~~~~~~~~~~~ | ||||||
|
||||||
|
||||||
Contributors | ||||||
~~~~~~~~~~~~ | ||||||
* :ghuser:`matsuobasho` | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -942,6 +942,13 @@ class Array: | |||||
|
||||||
name : str, optional | ||||||
Name of Array instance. | ||||||
|
||||||
Raises | ||||||
------ | ||||||
ValueError | ||||||
If `temperature_model_parameters` is None or if `racking_module` | ||||||
in the `mount` attribute and `module_type` are either None or cannot be | ||||||
used to infer the temperature model parameters. | ||||||
""" | ||||||
|
||||||
def __init__(self, mount, | ||||||
|
@@ -977,6 +984,18 @@ def __init__(self, mount, | |||||
else: | ||||||
self.temperature_model_parameters = temperature_model_parameters | ||||||
|
||||||
if self.temperature_model_parameters=={}: | ||||||
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.
Suggested change
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. @matsuobasho I agree with @kandersolar point of view, that we should remove this 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. It'll be most efficient to delete this entire MR because there are so many changes that will not be used. The proposed change is just deleting two lines and will be easiest to recreate with a new MR. Let me know if you can kill the entire MR. I'll then create a new MR with just that one change. In this case, it looks like we do not need a new test or any docstring modifications? 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. You can close this PR and start a new one. For the new PR I recommend that you first create a branch in your fork and use that branch for changes. Its not usually a good idea to make changes in your main branch. First reset your main branch git reset --hard upstream/ main where upstream is your name for pvlib/pvlib-python Then create a branch git checkout -b Make the edits in the branch, add, commit, push, etc. |
||||||
raise ValueError("The `temperature_model_parameters` is empty " | ||||||
"after an attempt to infer it. " | ||||||
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.
Suggested change
|
||||||
"Pass either `temperature_model_parameters` to " | ||||||
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.
Suggested change
|
||||||
"`Array` or `PVSystem` (if not passing arrays), or " | ||||||
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.
Suggested change
|
||||||
"`racking_module` to the `Array` `mount` " | ||||||
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.
Suggested change
|
||||||
"object and `module_type` to `Array. For guidance " | ||||||
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.
Suggested change
|
||||||
"on allowed values to use for `racking_module` and " | ||||||
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.
Suggested change
|
||||||
"`module_type`, examine the " | ||||||
"TEMPERATURE_MODEL_PARAMETERS global variable from " | ||||||
"the `temperature` module.") | ||||||
|
||||||
if array_losses_parameters is None: | ||||||
self.array_losses_parameters = {} | ||||||
else: | ||||||
|
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.