Skip to content

Commit

Permalink
[field] Implement Mesh.__eq__()
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Mar 25, 2024
1 parent 829d154 commit 9520481
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions phi/geom/_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ def __variable_attrs__(self):
def __value_attrs__(self):
return '_vertices',

def __eq__(self, other):
if self is other:
return True
if not isinstance(other, Mesh):
return False
return self._vertices == other._vertices and math.always_close(self._polygons, other._polygons) and self._boundaries == other._boundaries

@property
def shape(self) -> Shape:
return shape(self._polygons).non_spatial & channel(self._vertices)
Expand Down

0 comments on commit 9520481

Please sign in to comment.