Accept albedo in weather input to ModelChain.run_model method#1469
Accept albedo in weather input to ModelChain.run_model method#1469cwhanse merged 16 commits intopvlib:masterfrom
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.
Why not include albedo=None explicitly in the function signature instead of try/except and kwargs?
There was a problem hiding this comment.
Why not include
albedo=Noneexplicitly 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.
| 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.
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.
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.
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/referencefor API changes.docs/sphinx/source/whatsnewfor 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.