-
Notifications
You must be signed in to change notification settings - Fork 93
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
Use a looser tolerance on pitch for HexGrid roughly equal check #2058
Conversation
The default tolerance for |
Not sure how that disappeared but I did write out a Let me re-add that and add a test accordingly |
We don't need a super strict check to make sure the grids are roughly equal. The ideal of the method is to check that one index location in one grid would be in approximately the same spatial location in the other grid. Otherwise we can't accurately rotate the position within the grid. This problem came up in some shuffling work where two assemblies had ever so slightly different pitches, on the order of hundreths of a percent. The strict `other.pitch == self.pitch` failed even though, for the purposes of this method, the two grids are "roughly equal"
ce1cfa8
to
121d2c2
Compare
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.
Looks good, just need to add release notes
What is the change?
Use
math.isclose
to compare pitches of two hex grids rather than strict equality.Why is the change being made?
We don't need a super strict check to make sure the grids are roughly equal. The ideal of the method is to check that one index location in one grid would be in approximately the same spatial location in the other grid. Otherwise we can't accurately rotate the position within the grid.
This problem came up in some shuffling work where two assemblies had ever so slightly different pitches, on the order of hundreths of a percent. The strict
other.pitch == self.pitch
failed even though, for the purposes of this method, the two grids are "roughly equal"Checklist
doc
folder.pyproject.toml
.