coxeter icon indicating copy to clipboard operation
coxeter copied to clipboard

Poly Object should have `__eq__` property

Open b-butler opened this issue 6 years ago • 3 comments

Equality checks based on points would be useful for tests and general comparisons.

b-butler avatar Sep 06 '19 14:09 b-butler

Description

Shapes can be equivalent and we should be able to check that. If #11 is fixed using a simple check on vertices should be enough. We may want to consider vertices which are within a certain dx ~ 1e-6 from each other as equal.

Tasks

  • [ ] Implement __eq__ methods for Poly classes
  • [ ] Document functionality
  • [ ] Add unit test for functionality

b-butler avatar Nov 14 '19 19:11 b-butler

I would like to add equality checks, but I'm not comfortable with any tolerance-based checks. I think only exact equality should match, just like with numpy arrays or similar. We could add a separate method to check approximate equality.

vyasr avatar Jan 28 '21 01:01 vyasr

Hmm in that case we should probably just follow NumPy with an isclose method.

b-butler avatar Jan 28 '21 14:01 b-butler