Skip to content

Commit

Permalink
Ruff formatting (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd authored Jan 10, 2025
1 parent 6ccaa14 commit 4ee1020
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/meshtags.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def verify_meshtags(filename: Path):
np.testing.assert_allclose(
entity_midpoints[i][global_pos],
midpoint,
err_msg=f"{prefix}: Midpoint ({i , global_pos}) do not match",
err_msg=f"{prefix}: Midpoint ({i, global_pos}) do not match",
)
print(f"{prefix} Matching of all entities of dimension {i} successful")

Expand Down
4 changes: 2 additions & 2 deletions docs/original_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def create_xdmf_mesh(filename: Path):
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, filename.with_suffix(".xdmf"), "w") as xdmf:
xdmf.write_mesh(mesh)
xdmf.write_meshtags(facet_tag, mesh.geometry)
print(f"{mesh.comm.rank+1}/{mesh.comm.size} Mesh written to {filename.with_suffix('.xdmf')}")
print(f"{mesh.comm.rank + 1}/{mesh.comm.size} Mesh written to {filename.with_suffix('.xdmf')}")


mesh_file = Path("MyMesh.xdmf")
Expand Down Expand Up @@ -79,7 +79,7 @@ def write_function(
name="Output",
)
print(
f"{mesh.comm.rank+1}/{mesh.comm.size} Function written to ",
f"{mesh.comm.rank + 1}/{mesh.comm.size} Function written to ",
f"{function_filename.with_suffix('.bp')}",
)

Expand Down
2 changes: 1 addition & 1 deletion docs/time_dependent_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def compute_volume(mesh, time_stamp):
vol_local = dolfinx.fem.assemble_scalar(vol_form)
vol_glob = mesh.comm.allreduce(vol_local, op=MPI.SUM)
if mesh.comm.rank == 0:
print(f"{mesh.comm.rank+1}/{mesh.comm.size} Time: {time_stamp} Mesh Volume: {vol_glob}")
print(f"{mesh.comm.rank + 1}/{mesh.comm.size} Time: {time_stamp} Mesh Volume: {vol_glob}")


def write_meshes(filename: Path):
Expand Down
6 changes: 3 additions & 3 deletions tests/create_legacy_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import adios4dolfinx

a4d_version = version("adios4dolfinx")
assert (
a4d_version < "0.7.2"
), f"Creating a legacy checkpoint requires adios4dolfinx < 0.7.2, you have {a4d_version}."
assert a4d_version < "0.7.2", (
f"Creating a legacy checkpoint requires adios4dolfinx < 0.7.2, you have {a4d_version}."
)


def f(x):
Expand Down

0 comments on commit 4ee1020

Please sign in to comment.