-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Accept albedo in weather input to ModelChain.run_model method #1469
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
Conversation
Ready for review, I think. PVSystem methods and functions expect albedo on each Array. I have left albedo as a I've added code to ModelChain.prepare_inputs to move albedo from |
pvlib/pvsystem.py
Outdated
try: | ||
albedo = kwargs.pop('albedo') | ||
except KeyError: | ||
albedo = None |
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.
Why not include albedo=None
explicitly in the function signature instead of try/except and kwargs
?
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.
Why not include
albedo=None
explicitly in the function signature instead of try/except andkwargs
?
It seems odd to add albedo
as a PVSystem
method argument when the corresponding property PVSystem.albedo
is deprecated. Or, I was flailing around trying to get the tests to work.
@@ -8,15 +8,17 @@ Deprecations | |||
|
|||
Enhancements | |||
~~~~~~~~~~~~ | |||
* albedo can now be provided as a column in the `weather` DataFrame input to | |||
:py:method:`pvlib.modelchain.ModelChain.run_model`. (:issue:`1387`, :pull:`1469`) |
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 suppose the PVSystem
and Array
changes should be noted too
mc = ModelChain(sapm_dc_snl_ac_system_Array, location) | ||
# albedo on pvsystem but not in weather | ||
weather = pd.DataFrame({'ghi': 1, 'dhi': 1, 'dni': 1, 'albedo': 0.5}, | ||
index=times) |
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.
FYI this comment doesn't match the test code
pvlib/tracking.py
Outdated
if albedo is None: | ||
try: | ||
albedo = kwargs.pop('albedo') | ||
except KeyError: |
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 it's not possible for kwargs
to contain albedo
here since it's already a named parameter to this function.
WHOOPS! I merged this by mistake. I had another github repo open and hit merge in the wrong browser tab. |
[ ] Updates entries indocs/sphinx/source/reference
for API changes.docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).Tests pvlib.irradiance and pvlib.clearsky functions with albedo as a Series.
Allows albedo to be specified as a column in weather for ModelChain methods.