-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Raise helpful exceptions for irradiance.gti_dirint #2347
base: main
Are you sure you want to change the base?
Conversation
@@ -2368,6 +2368,9 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, | |||
irradiance, Solar Energy 122, 1037-1046. | |||
:doi:`10.1016/j.solener.2015.10.024` | |||
""" | |||
# check input data and raise Exceptions where data will cause the | |||
# algorithm to fail | |||
_gti_dirint_check_input(aoi) |
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 wouldn't bother with a function for this.
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 wouldn't either if this was the only condition to check. But I'm certain there are other data requirements which we haven't deduced yet and thought it helpful to put the function in place to collect checks.
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.
There's probably some pythonic aphorism for these situations.
Co-authored-by: Anton Driesse <[email protected]>
[] 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.gti_dirint
could fail for a number of not-well-defined conditions. One known condition is reported in #1342, where all inputs have AOI >= 90.I could not determine exactly how much data is "required" by
gti_dirint
. For instance, if there are insufficient daily data with 60 < AOI < 85 (see these lines), the function will proceed withkt_prime_gte_90= np.nan
and will basically assume that the day is entirely clear at this line. I can't say that's a failure of the code, but I'm skeptical thatgti_dirint
will return anything meaningful. I don't know if we want to check, or what exception or warning to raise.In any case, the check added in this PR closes the issue reported in #1342, and sets up
gti_dirint
to have additional checks added, should that be desired.