Add support for return_components to irradiance.isotropic#2787
Open
cbcrespo wants to merge 6 commits into
Open
Add support for return_components to irradiance.isotropic#2787cbcrespo wants to merge 6 commits into
cbcrespo wants to merge 6 commits into
Conversation
Member
|
Misssing a whatsnew entry fyi |
echedey-ls
reviewed
Jun 23, 2026
Member
There was a problem hiding this comment.
Nice PR! I want to open a discussion on the formatting of the conditional return style. Edit: as pointed out in a review comment by @cbcrespo , proposed style is already incorporated in irradiance.perez so this discussion deserves other place, if any.
Related to the previous striked-through comment
Scipy does this: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.brentq.html#scipy.optimize.brentq
I personally would prefer the two return items, separately, with the annotation present if ... is True/False or something like that. E.g.:
sky_diffuse : numeric (if ``return_components`` is ``False``)
The sky diffuse component of the solar radiation. [Wm⁻²]
diffuse_components : Dict (array input) or DataFrame (Series input) (if ``return_components`` is ``True``)
Keys/columns are:
* poa_sky_diffuse: Total sky diffuse
* poa_isotropic
a83746d to
97a34f6
Compare
Contributor
Author
|
I don't understand why the docs build is failing? I checked the log and there doesn't seem to be anything related to my work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #xxxxdocs/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`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.This PR is part of my GSoC 2026 project. One of the goals is to add support for
return_componentsto all diffuse transposition models inpvlib, 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 (default), or are interested in the split between different diffuse components (sky diffuse, circumsolar, horizon brightening).This has been implemented for irradiance.reindl in #2775.
For
irradiance.isotropicspecifically,return_components=Truedoes not return additional information, but has been added in order to be consistent with other diffuse transposition models.The docstrings have been changed accordingly, and a new test was added.