-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
std_score
could give nan
instead of ValueError
if standard_deviation = 0
?
#272
Comments
@jagerber48 I don't have a strong opinion. I probably lean towards: NaNs are more painful as their effect is not noticed where it originates but in later code where it is used. It might be reasonable for this function to drop try/except and just be
I think aZeroDivisionError raised from this would be clearer than a ValueError, which would seem to imply that the value passed in for |
@newville thanks for the feedback. I'm thinking about a case where there is an array of I also don't know how prevalently this function is used. I've never used it. I just came across this detail as I was working on the linear combination refactor PR and posted here to track it. |
@jagerber48 If I would say that IMHO: But also: not a strong preference. And I also never use this function ;). |
Taking your comments into review:
I'll probably leave this discussion here for a while since there are higher priorities. Curious to hear others' thoughts in the meantime. |
Right now the
std_score
function raises aValueError
if it is called on anAffineScalarFunc
with zero standard deviation. Should it returnnan
, possibly with a warning instead?uncertainties/uncertainties/core.py
Line 591 in 969324d
The text was updated successfully, but these errors were encountered: