Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore false-positive use-before-assign warnings from pylint #415

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions meshmode/discretization/connection/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def make_face_restriction(actx, discr, group_factory, boundary_tag,

face_unit_nodes = face.map_to_volume(bdry_unit_nodes)
resampling_mat = mp.resampling_matrix(
vol_basis,
vol_basis, # pylint: disable=possibly-used-before-assignment
face_unit_nodes, mgrp.unit_nodes)

# }}}
Expand All @@ -321,11 +321,11 @@ def make_face_restriction(actx, discr, group_factory, boundary_tag,
# Find vertex_indices
glob_face_vertices = mgrp.vertex_indices[
batch_boundary_el_numbers_in_grp][:, face.volume_vertex_indices]
vertex_indices[new_el_numbers] = \
vol_to_bdry_vertices[glob_face_vertices]
vertex_indices[new_el_numbers] = ( # pylint: disable=possibly-used-before-assignment # noqa: E501
vol_to_bdry_vertices[glob_face_vertices])

# Find nodes
nodes[:, new_el_numbers, :] = np.einsum(
nodes[:, new_el_numbers, :] = np.einsum( # pylint: disable=possibly-used-before-assignment # noqa: E501
"ij,dej->dei",
resampling_mat,
mgrp.nodes[:, batch_boundary_el_numbers_in_grp, :])
Expand Down
3 changes: 3 additions & 0 deletions test/test_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,9 @@ def test_box_boundary_tags(dim, nelem, mesh_type, group_cls, visualize=False):
nelements_per_axis = (nelem,)*3
btag_to_face = {"btag_test_1": ["+x", "-y", "-z"],
"btag_test_2": ["+y", "-x", "+z"]}
else:
raise AssertionError("unexpected dim")

mesh = mgen.generate_regular_rect_mesh(a=a, b=b,
nelements_per_axis=nelements_per_axis, order=3,
boundary_tag_to_face=btag_to_face,
Expand Down
4 changes: 2 additions & 2 deletions test/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ def test_partition_mesh(mesh_size, num_parts, num_groups, dim, scramble_parts):
assert found_reverse_adj, ("InterPartAdjacencyGroup is not "
"consistent")

p_grp_num = find_group_indices(mesh.groups, p_meshwide_elem)
p_n_grp_num = find_group_indices(mesh.groups, p_meshwide_n_elem)
p_grp_num = find_group_indices(mesh.groups, p_meshwide_elem) # pylint: disable=possibly-used-before-assignment # noqa: E501
p_n_grp_num = find_group_indices(mesh.groups, p_meshwide_n_elem) # pylint: disable=possibly-used-before-assignment # noqa: E501

p_elem_base = mesh.base_element_nrs[p_grp_num]
p_n_elem_base = mesh.base_element_nrs[p_n_grp_num]
Expand Down
Loading