-
Notifications
You must be signed in to change notification settings - Fork 9
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
Handle some floating point edge cases in truncation #65
base: main
Are you sure you want to change the base?
Conversation
@@ -168,7 +168,9 @@ def truncate_binary_search( | |||
lower_error = 0.0 | |||
|
|||
# binary search for a cutoff threshold | |||
while ((upper_threshold - lower_threshold) > 1e-10) and (upper_error != lower_error): | |||
while ((upper_threshold - lower_threshold) > 1e-10) and not ( | |||
np.isclose(upper_error, lower_error) |
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.
default atol
is 1e-8, @BryceFuller , @mrossinek . Is that fine? We don't take a tolerance to this func as input
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.
It seems a bit arbitrary to me, to mix the 1e-10
threshold in the first statement with an atol=1e-8
and rtol=1e-5
in np.isclose
. If we could unify that and maybe even expose it as a setting that would be better imo
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.
@BryceFuller and I are also trying to determine if we need both while
conditionals here. Need to think on it a bit before finishing this up
Pull Request Test Coverage Report for Build 13680724529Details
💛 - Coveralls |
No description provided.