Skip to content

Add support for return_components to Reindl#2775

Open
cbcrespo wants to merge 2 commits into
pvlib:mainfrom
cbcrespo:reindl-components
Open

Add support for return_components to Reindl#2775
cbcrespo wants to merge 2 commits into
pvlib:mainfrom
cbcrespo:reindl-components

Conversation

@cbcrespo

@cbcrespo cbcrespo commented Jun 9, 2026

Copy link
Copy Markdown
  • 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.

This PR is part of my GSoC 2026 project. One of the goals is to add support for return_components to all diffuse transposition models in pvlib, which currently is supported by some models (e.g. perez) but not others. This parameter allows the user to choose whether they want only the total diffuse irradiance, or are interested in the split between different diffuse components (sky diffuse, circumsolar, horizon brightening).

This first PR starts by implementing return_components in reindl.

Reindl expands the Hay and Davies model, which considers only the isotropic and circumsolar components, and is defined as:
imagem
with A Rb being the circumsolar component and the rest being the isotropic component.

Reindl expands this by adding a horizon brightening component, but this new component is not additive but rather multiplied by the existing isotropic component:
imagem

In my implementation, I essentially considered that the isotropic term was:
imagem
while the horizon brightening term was:
imagem

I updated the function docstrings accordingly. I haven't yet added a test. I saw that e.g. haydavies has two separate tests, for return_components=False and return_components=True. However, from what I gathered, the test values came from the matlab implementation of pvlib, and therefore it seems kind of silly to create a test using values derived from the python implementation to test the python implementation. Curious as to what are the community's thoughts on this.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Hey @cbcrespo! 🎉

Thanks for opening your first pull request! We appreciate your
contribution. Please ensure you have reviewed and understood the
contributing guidelines.

If AI is used for any portion of this PR, you must vet the content
for technical accuracy.

@kandersolar kandersolar added enhancement GSoC Contributions related to Google Summer of Code. labels Jun 9, 2026
@kandersolar kandersolar added this to the v0.15.2 milestone Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement GSoC Contributions related to Google Summer of Code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants