-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Accept albedo in weather input to ModelChain.run_model method #1478
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
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.
Some very minor comments, but LGTM. I think we've said in the past that there's no need to add new functionality to SingleAxisTracker
, but I don't mind leaving it in seeing as you've already gone to the effort of adding it :)
Co-authored-by: Kevin Anderson <[email protected]>
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.
Thanks @cwhanse for the big lift.
pvlib/tests/test_pvsystem.py
Outdated
[0., -0., 0., 0., 0.]]), | ||
columns=['poa_global', 'poa_direct', 'poa_diffuse', 'poa_sky_diffuse', | ||
'poa_ground_diffuse'], | ||
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.
I think we need similar test for Array.
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'm not seeing the gap to be filled by an Array test. PVSystem.get_irradiance
is (mostly) a wrapper for Array.get_irradiance
, so this PVSystem test confirms that data passes through to irradiance.get_total_irradiance
and back.
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.
That's true, but Array
is an independent part of the API. So far we've been pretty good about testing that each layer of the API returns the correct values or make assertions that the correct parameters are passed through. A relatively easy approach would be to create a copy of test_PVSystem_multi_array_get_irradiance
with values set for all of the optional method arguments.
I won't object if others think this is unnecessary.
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.
Makes sense. It's just that we should construct a new solution due to changing the kwargs from default. test_PVSystem_multi_array_get_irradiance_multi_irrad
confirms that PVSystem.get_irradiance and Array.get_irradiance return consistent values.
I note a small inconsistency has crept in: Array.get_irradiance defaults to the Hay-Davies model, whereas irradiance.get_total_irradiance
defaults to the isotropic sky diffuse model.
Co-authored-by: Will Holmgren <[email protected]>
@cwhanse this PR has one line that fails stickler. any other reasons to hold off on merging it? |
@wholmgren it's ready as far as I know. I fixed that line. |
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.
@kanderso-nrel ready to merge?
Reading back through #1387, several people advocated for raising an error if albedo was specified in both |
|
On third thought, I think the current behavior (weather albedo is used when present, otherwise The default for |
One improvement that could be made: when |
[ ] 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`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.Re-opens #1469.
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.