Skip to content

add orgill hollands decomposition #1730

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

Merged
merged 15 commits into from
Jun 29, 2023
Merged

Conversation

nicorie
Copy link
Contributor

@nicorie nicorie commented May 10, 2023

  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries in docs/sphinx/source/reference for API changes.
  • Adds description and name entries in the appropriate "what's new" file in 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`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

This PR adds the Orgill and Hollands decomposition model (https://doi.org/10.1016/0038-092X(77)90006-8) to the irradiance module.

bolland

"""
dni_extra = get_extra_radiation(datetime_or_doy)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add an argument dni_extra=None and calculate here only if dni_extra is None? Orgill and Hollands didn't specify the solar constant they used. It may be useful to provide users an option besides the pvlib default.

@kandersolar kandersolar added this to the 0.9.6 milestone May 12, 2023
@kandersolar kandersolar modified the milestones: 0.9.6, 0.10.0 May 16, 2023
@kandersolar
Copy link
Member

Hi @nicorie, the next step here is for you to push new commits with updates according to Cliff's review above. Just a heads up in case the PR review process isn't clear :)

nicorie and others added 5 commits May 25, 2023 13:04
correct spelling to 'boland'

Co-authored-by: Cliff Hansen <[email protected]>
correct citation formating

Co-authored-by: Cliff Hansen <[email protected]>
correct citation formatting

Co-authored-by: Cliff Hansen <[email protected]>
correct spelling 'boland'

Co-authored-by: Cliff Hansen <[email protected]>
adding dni_extra argument per cliff's suggestion.
@nicorie
Copy link
Contributor Author

nicorie commented May 25, 2023

Hi @nicorie, the next step here is for you to push new commits with updates according to Cliff's review above. Just a heads up in case the PR review process isn't clear :)

@kandersolar thank you for the heads up. @cwhanse I pushed several commits per your comments. please check.

@cwhanse
Copy link
Member

cwhanse commented May 25, 2023

@nicorie sometimes git has issues when new code is similar to nearby, older code - such is the case here with boland being similar to the new function.

Two space indent on the 2nd and later lines of a reference.

We need to describe the function output.

Need to add a few tests. We could compute output for some short, assumed input using the old PVLib for Matlab function, but with this simple calculation I think it's better to just do it in a spreadsheet. No need to include the spreadsheet as a data file if you choose that way.

@AdamRJensen
Copy link
Member

@nicorie I've gone ahead and fixed the merge conflict that occurred and the reference formatting Cliff was mentioning. For these changes to show up on your local branch you need to click "fetch origin" in GitHub Desktop:
image

The next step is for you to add some tests. 🥳 The easiest thing is to mimic the test for the Erbs function since the two functions are very similar. Don't hesitate to ask questions!

@cwhanse
Copy link
Member

cwhanse commented Jun 23, 2023

@nicorie I'm happy to add the unit tests if you'd like me to do that.

nicorie added 2 commits June 25, 2023 20:09
fixing the perilous outcome of copy/pasting the test_boland function.
@nicorie
Copy link
Contributor Author

nicorie commented Jun 25, 2023

@cwhanse thanks but @AdamRJensen was kind enough to give me a crash course on tests.

I added a test_orgill_hollands function to test_irradiance.py. It is a replica of test_boland, but the dni and dhi columns in the expected output array are updated to reflect the orgill and hollands model. The kt values were selected based on what was used previously for the test_erbs and test_boland function, but these kt values still cover all three piece wise functions of the orgill and hollands model.

I ran the pytest in my anaconda prompt. I get 6 warnings (that I don't understand) and 1 pass.
image

Copy link
Member

@AdamRJensen AdamRJensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done @nicorie! Looks good to me 😄

@kandersolar
Copy link
Member

I think the only thing missing now is a note in the what's new page; can you add an entry for this new function under Enhancements in the v0.10.0 file? And yourself to the contributors list at the bottom of that file :)

I get 6 warnings (that I don't understand)

Those are unrelated to your test and can be ignored for this PR. Sorry for the clutter!

nicorie and others added 2 commits June 28, 2023 13:02
Adding Orgill Hollands model to list of enhancements.
Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @nicorie and congratulations on your first merged PR to pvlib-python :)

@kandersolar kandersolar merged commit fa9dc9b into pvlib:main Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants