Skip to content

Commit

Permalink
fix new flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Jul 30, 2023
1 parent a70af36 commit 6e8a963
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions meshmode/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def copy(self, **kwargs: Any) -> "MeshElementGroup":

def __eq__(self, other):
return (
type(self) == type(other)
type(self) is type(other)
and self.order == other.order
and np.array_equal(self.vertex_indices, other.vertex_indices)
and np.array_equal(self.nodes, other.nodes)
Expand Down Expand Up @@ -556,7 +556,7 @@ def copy(self, **kwargs: Any) -> "NodalAdjacency":

def __eq__(self, other):
return (
type(self) == type(other)
type(self) is type(other)
and np.array_equal(self.neighbors_starts, other.neighbors_starts)
and np.array_equal(self.neighbors, other.neighbors))

Expand Down Expand Up @@ -612,7 +612,7 @@ def copy(self, **kwargs: Any) -> "FacialAdjacencyGroup":

def __eq__(self, other):
return (
type(self) == type(other)
type(self) is type(other)
and self.igroup == other.igroup)

def __ne__(self, other):
Expand All @@ -629,7 +629,7 @@ def as_python(self) -> str:
:returns: a string that can be evaluated to reconstruct the class.
"""

if type(self) != FacialAdjacencyGroup:
if type(self) is not FacialAdjacencyGroup:
raise NotImplementedError(
f"Not implemented for '{type(self).__name__}'.")

Expand Down Expand Up @@ -703,7 +703,7 @@ def __eq__(self, other):
and self.aff_map == other.aff_map)

def as_python(self):
if type(self) != InteriorAdjacencyGroup:
if type(self) is not InteriorAdjacencyGroup:
raise NotImplementedError(f"Not implemented for {type(self)}.")

return self._as_python(
Expand Down Expand Up @@ -755,7 +755,7 @@ def __eq__(self, other):
and np.array_equal(self.element_faces, other.element_faces))

def as_python(self):
if type(self) != BoundaryAdjacencyGroup:
if type(self) is not BoundaryAdjacencyGroup:
raise NotImplementedError(f"Not implemented for {type(self)}.")

return self._as_python(
Expand Down Expand Up @@ -837,7 +837,7 @@ def __eq__(self, other):
and self.aff_map == other.aff_map)

def as_python(self):
if type(self) != InterPartAdjacencyGroup:
if type(self) is not InterPartAdjacencyGroup:
raise NotImplementedError(f"Not implemented for {type(self)}.")

return self._as_python(
Expand Down Expand Up @@ -1177,7 +1177,7 @@ def facial_adjacency_groups(self) -> Sequence[Sequence[FacialAdjacencyGroup]]:

def __eq__(self, other):
return (
type(self) == type(other)
type(self) is type(other)
and np.array_equal(self.vertices, other.vertices)
and self.groups == other.groups
and self.vertex_id_dtype == other.vertex_id_dtype
Expand Down
2 changes: 1 addition & 1 deletion meshmode/mesh/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ def merge_disjoint_meshes(
ref_group = single_valued(
[group for mesh in meshes for group in mesh.groups],
lambda x, y: (
type(x) == type(y)
type(x) is type(y)
and x.order == y.order
and np.array_equal(x.unit_nodes, y.unit_nodes)
))
Expand Down
8 changes: 4 additions & 4 deletions test/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,12 @@ def test_partition_mesh(mesh_size, num_parts, num_groups, dim, scramble_parts):
for idx in range(len(adj.elements)):
if (p_elem == adj.elements[idx]
and face == adj.element_faces[idx]):
assert p_n_elem == adj.neighbors[idx],\
assert p_n_elem == adj.neighbors[idx], \
"Tag does not give correct neighbor"
assert n_face == adj.neighbor_faces[idx],\
assert n_face == adj.neighbor_faces[idx], \
"Tag does not give correct neighbor"

assert ipagrp_count > 0 or not has_cross_rank_adj,\
assert ipagrp_count > 0 or not has_cross_rank_adj, \
"expected at least one InterPartAdjacencyGroup"

for i_remote_part in range(num_parts):
Expand All @@ -347,7 +347,7 @@ def test_partition_mesh(mesh_size, num_parts, num_groups, dim, scramble_parts):
if (i_local_part, i_remote_part) in connected_parts:
tag_sum += count_tags(
part_meshes[i_local_part], BTAG_PARTITION(i_remote_part))
assert num_tags[i_remote_part] == tag_sum,\
assert num_tags[i_remote_part] == tag_sum, \
"part_mesh has the wrong number of BTAG_PARTITION boundaries"


Expand Down

0 comments on commit 6e8a963

Please sign in to comment.