-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Equality checks fail for EstimatorResult
objects
#9464
Comments
It's not a good idea to check equality of floating-point values with print(0.1 + 0.1 + 0.1 == 0.3)
# False I suggest np.allclose for the comparison of So, it might be an option to set |
That is a good point @t-imamichi. It might be even better to provide a custom Nonetheless, I have to insist in moving away from numpy types though. The |
I prefer introducing a utility function of the equality check based on I don't have a strong opinion of the type of |
My recommendation is
Do these even compare metadata content? |
I close this because the Primitives V1 is deprecated #12575 |
Environment
What is happening?
Equality checks fail in
EstimatorResult
objects becausevalues
attr isnp.array
and==
is not well behaved for those.How can we reproduce the issue?
Outputs:
What should happen?
Equality should return
True
orFalse
appropriately.Any suggestions?
We should move to using tuple (i.e. immutable, core python types) instead or
np.array
.The text was updated successfully, but these errors were encountered: