Skip to content
Snippets Groups Projects
Commit bec0b5a9 authored by Sebastian Müller's avatar Sebastian Müller 🐈
Browse files

grid: compatible unstructured grids should have same cells either way

parent d4249601
No related branches found
No related tags found
1 merge request!280Optional location check
Pipeline #208200 failed with stages
in 3 minutes and 23 seconds
...@@ -220,10 +220,14 @@ class Grid(GridBase): ...@@ -220,10 +220,14 @@ class Grid(GridBase):
): ):
return False return False
if self.data_shape != other.data_shape: if check_location and self.data_shape != other.data_shape:
return False return False
return np.allclose(self.data_points, other.data_points) return (
np.allclose(self.points, other.points)
and self.cells == other.cells
and self.cell_types == other.cell_types
)
def __eq__(self, other): def __eq__(self, other):
return self.compatible_with(other) return self.compatible_with(other)
...@@ -424,7 +428,7 @@ class StructuredGrid(Grid): ...@@ -424,7 +428,7 @@ class StructuredGrid(Grid):
): ):
return False return False
if self.data_shape != ( if check_location and self.data_shape != (
other.data_shape[::-1] other.data_shape[::-1]
if self.axes_reversed != other.axes_reversed if self.axes_reversed != other.axes_reversed
else other.data_shape else other.data_shape
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment