Skip to content

Commit 6e8a963

Browse files
alexfiklinducer
authored andcommitted
fix new flake8 errors
1 parent a70af36 commit 6e8a963

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

meshmode/mesh/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def copy(self, **kwargs: Any) -> "MeshElementGroup":
330330

331331
def __eq__(self, other):
332332
return (
333-
type(self) == type(other)
333+
type(self) is type(other)
334334
and self.order == other.order
335335
and np.array_equal(self.vertex_indices, other.vertex_indices)
336336
and np.array_equal(self.nodes, other.nodes)
@@ -556,7 +556,7 @@ def copy(self, **kwargs: Any) -> "NodalAdjacency":
556556

557557
def __eq__(self, other):
558558
return (
559-
type(self) == type(other)
559+
type(self) is type(other)
560560
and np.array_equal(self.neighbors_starts, other.neighbors_starts)
561561
and np.array_equal(self.neighbors, other.neighbors))
562562

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

613613
def __eq__(self, other):
614614
return (
615-
type(self) == type(other)
615+
type(self) is type(other)
616616
and self.igroup == other.igroup)
617617

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

632-
if type(self) != FacialAdjacencyGroup:
632+
if type(self) is not FacialAdjacencyGroup:
633633
raise NotImplementedError(
634634
f"Not implemented for '{type(self).__name__}'.")
635635

@@ -703,7 +703,7 @@ def __eq__(self, other):
703703
and self.aff_map == other.aff_map)
704704

705705
def as_python(self):
706-
if type(self) != InteriorAdjacencyGroup:
706+
if type(self) is not InteriorAdjacencyGroup:
707707
raise NotImplementedError(f"Not implemented for {type(self)}.")
708708

709709
return self._as_python(
@@ -755,7 +755,7 @@ def __eq__(self, other):
755755
and np.array_equal(self.element_faces, other.element_faces))
756756

757757
def as_python(self):
758-
if type(self) != BoundaryAdjacencyGroup:
758+
if type(self) is not BoundaryAdjacencyGroup:
759759
raise NotImplementedError(f"Not implemented for {type(self)}.")
760760

761761
return self._as_python(
@@ -837,7 +837,7 @@ def __eq__(self, other):
837837
and self.aff_map == other.aff_map)
838838

839839
def as_python(self):
840-
if type(self) != InterPartAdjacencyGroup:
840+
if type(self) is not InterPartAdjacencyGroup:
841841
raise NotImplementedError(f"Not implemented for {type(self)}.")
842842

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

11781178
def __eq__(self, other):
11791179
return (
1180-
type(self) == type(other)
1180+
type(self) is type(other)
11811181
and np.array_equal(self.vertices, other.vertices)
11821182
and self.groups == other.groups
11831183
and self.vertex_id_dtype == other.vertex_id_dtype

meshmode/mesh/processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ def merge_disjoint_meshes(
848848
ref_group = single_valued(
849849
[group for mesh in meshes for group in mesh.groups],
850850
lambda x, y: (
851-
type(x) == type(y)
851+
type(x) is type(y)
852852
and x.order == y.order
853853
and np.array_equal(x.unit_nodes, y.unit_nodes)
854854
))

test/test_partition.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ def test_partition_mesh(mesh_size, num_parts, num_groups, dim, scramble_parts):
333333
for idx in range(len(adj.elements)):
334334
if (p_elem == adj.elements[idx]
335335
and face == adj.element_faces[idx]):
336-
assert p_n_elem == adj.neighbors[idx],\
336+
assert p_n_elem == adj.neighbors[idx], \
337337
"Tag does not give correct neighbor"
338-
assert n_face == adj.neighbor_faces[idx],\
338+
assert n_face == adj.neighbor_faces[idx], \
339339
"Tag does not give correct neighbor"
340340

341-
assert ipagrp_count > 0 or not has_cross_rank_adj,\
341+
assert ipagrp_count > 0 or not has_cross_rank_adj, \
342342
"expected at least one InterPartAdjacencyGroup"
343343

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

353353

0 commit comments

Comments
 (0)