Skip to content

Commit 92d1a1b

Browse files
committed
Adapt to new ruff version
1 parent 65f6c30 commit 92d1a1b

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

python/demo/demo_comm-pattern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def plot_bar(G: nx.MultiGraph):
9595
num_edges = [len(nbrs) for _, nbrs in G.adj.items()]
9696
weights = [sum(data["weight"] for nbr, data in nbrs.items()) for _, nbrs in G.adj.items()]
9797

98-
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
98+
_fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
9999

100100
ax1.bar(ranks, num_edges)
101101
ax1.set_xlabel("rank")

python/dolfinx/pkgconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def _pkgconfig_query(s):
1818
pkg_config_exe = os.environ.get("PKG_CONFIG", None) or "pkg-config"
1919
cmd = [pkg_config_exe, *s.split()]
2020
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
21-
out, err = proc.communicate()
21+
out, _err = proc.communicate()
2222
rc = proc.returncode
2323
return (rc, out.rstrip().decode("utf-8"))
2424

python/test/unit/fem/test_custom_assembler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def test_custom_mesh_loop_rank1(dtype):
327327
# Assemble using generated tabulate_tensor kernel and Numba
328328
# assembler
329329
b3 = Function(V, dtype=dtype)
330-
ufcx_form, module, code = dolfinx.jit.ffcx_jit(
330+
ufcx_form, _module, _code = dolfinx.jit.ffcx_jit(
331331
mesh.comm, L, form_compiler_options={"scalar_type": dtype}
332332
)
333333

python/test/unit/io/test_xdmf_mesh.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ def test_read_write_p2_mesh(tempdir, encoding):
131131
assert np.all(idx[srt] == np.arange(len(idx)))
132132
x = points[srt]
133133

134-
element_types, element_tags, node_tags = model.mesh.getElements(dim=3)
134+
element_types, _element_tags, node_tags = model.mesh.getElements(dim=3)
135135
(
136-
name,
137-
dim,
138-
order,
136+
_name,
137+
_dim,
138+
_order,
139139
num_nodes,
140-
local_coords,
141-
num_first_order_nodes,
140+
_local_coords,
141+
_num_first_order_nodes,
142142
) = model.mesh.getElementProperties(element_types[0])
143143
cells = node_tags[0].reshape(-1, num_nodes) - 1
144144
num_nodes, gmsh_cell_id = MPI.COMM_WORLD.bcast(

python/test/unit/mesh/test_higher_order_mesh.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -761,14 +761,14 @@ def test_gmsh_input_2d(order, cell_type, dtype):
761761
assert np.all(idx[srt] == np.arange(len(idx)))
762762
x = points[srt]
763763

764-
element_types, element_tags, node_tags = gmsh.model.mesh.getElements(dim=2)
764+
element_types, _element_tags, node_tags = gmsh.model.mesh.getElements(dim=2)
765765
(
766-
name,
767-
dim,
766+
_name,
767+
_dim,
768768
order,
769769
num_nodes,
770-
local_coords,
771-
num_first_order_nodes,
770+
_local_coords,
771+
_num_first_order_nodes,
772772
) = gmsh.model.mesh.getElementProperties(element_types[0])
773773

774774
cells = node_tags[0].reshape(-1, num_nodes) - 1
@@ -827,14 +827,14 @@ def test_gmsh_input_3d(order, cell_type, dtype):
827827
assert np.all(idx[srt] == np.arange(len(idx)))
828828
x = points[srt]
829829

830-
element_types, element_tags, node_tags = gmsh.model.mesh.getElements(dim=3)
830+
element_types, _element_tags, node_tags = gmsh.model.mesh.getElements(dim=3)
831831
(
832-
name,
833-
dim,
832+
_name,
833+
_dim,
834834
order,
835835
num_nodes,
836-
local_coords,
837-
num_first_order_nodes,
836+
_local_coords,
837+
_num_first_order_nodes,
838838
) = gmsh.model.mesh.getElementProperties(element_types[0])
839839

840840
cells = node_tags[0].reshape(-1, num_nodes) - 1

python/test/unit/refinement/test_interval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@pytest.mark.parametrize("option", [mesh.RefinementOption.none, mesh.RefinementOption.parent_cell])
2222
def test_refine_interval(n, ghost_mode, ghost_mode_refined, option):
2323
msh = mesh.create_interval(MPI.COMM_WORLD, n, [0, 1], ghost_mode=ghost_mode)
24-
msh_refined, edges, vertices = mesh.refine(
24+
msh_refined, edges, _vertices = mesh.refine(
2525
msh, option=option, partitioner=mesh.create_cell_partitioner(ghost_mode_refined)
2626
)
2727
# TODO: add create_cell_partitioner(ghost_mode) when works
@@ -47,7 +47,7 @@ def test_refine_interval(n, ghost_mode, ghost_mode_refined, option):
4747
)
4848
def test_refine_interval_adaptive(n, ghost_mode, ghost_mode_refined):
4949
msh = mesh.create_interval(MPI.COMM_WORLD, n, [0, 1], ghost_mode=ghost_mode)
50-
msh_refined, edges, vertices = mesh.refine(
50+
msh_refined, edges, _vertices = mesh.refine(
5151
msh,
5252
np.arange(10, dtype=np.int32),
5353
option=mesh.RefinementOption.parent_cell,

0 commit comments

Comments
 (0)