Floating point comparisons: inform or protect the user? #4744
Closed
trexfeathers
started this conversation in
General
Replies: 2 comments 5 replies
-
I know we’ve said we don’t want to proliferate warnings, and in general I am in agreement with that. But if a cell doesn’t have bounds and |
Beta Was this translation helpful? Give feedback.
2 replies
-
Team have discussed an alternative API something like
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently promised to look at changing
Constraint
s to use approximate comparisons, to avoid floating point comparison problems (stemming from #4700). I now think there are compelling arguments for not doing this, but to instead lean on / enhance the existing warning in the user guide.What does everyone else think? There was a lot of support for changing to approximate equality in a recent team discussion.
np.isclose()
,pd.testing.assert_frame_equal(check_exact=False)
).Constraint
s - much ofConstraint
equality usesCell
equality.>
/>=
/<=
/<
operations onCell
s?Constraint
s, consistent behaviour might be expected.Cell.__eq__()
- see point 2 - but conversation with @bjlittle suggests that some of us might see this as a line to not cross.Constraint
s approach equality in several different ways depending on the specific circumstance, so==
andin
are used on many different lines, some calling down toCell.__eq__()
while others are doing raw comparisons of values.Constraint
s.Further reading:
_CoordConstraint.extract()
Cell.__eq__()
Beta Was this translation helpful? Give feedback.
All reactions