Skip to content

Commit

Permalink
Ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells committed Jan 9, 2025
1 parent 412ab11 commit b265a9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion python/demo/demo_half_loaded_waveguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def Omega_v(x):
# Verify if kz is consistent with the analytical equations
assert verify_mode(kz, w, h, d, lmbd0, eps_d, eps_v, threshold=1e-4)

print(f"eigenvalue: {-kz**2}")
print(f"eigenvalue: {-(kz**2)}")
print(f"kz: {kz}")
print(f"kz/k0: {kz / k0}")

Expand Down
12 changes: 6 additions & 6 deletions python/dolfinx/fem/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ def __init__(
if dtype is None:
dtype = default_scalar_type

assert np.issubdtype(
V.element.dtype, np.dtype(dtype).type(0).real.dtype
), "Incompatible FunctionSpace dtype and requested dtype."
assert np.issubdtype(V.element.dtype, np.dtype(dtype).type(0).real.dtype), (
"Incompatible FunctionSpace dtype and requested dtype."
)

# Create cpp Function
def functiontype(dtype):
Expand Down Expand Up @@ -592,9 +592,9 @@ def functionspace(
element = finiteelement(mesh.topology.cell_type, ufl_e, dtype)
cpp_dofmap = _cpp.fem.create_dofmap(mesh.comm, mesh.topology._cpp_object, element._cpp_object)

assert np.issubdtype(
mesh.geometry.x.dtype, element.dtype
), "Mesh and element dtype are not compatible."
assert np.issubdtype(mesh.geometry.x.dtype, element.dtype), (
"Mesh and element dtype are not compatible."
)

# Initialize the cpp.FunctionSpace
try:
Expand Down
2 changes: 1 addition & 1 deletion python/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def _global_dot(comm, v0, v1):
p.array[:nr] = beta * p.array[:nr] + r

raise RuntimeError(
f"Solver exceeded max iterations ({maxit}). Relative residual={rnorm/rnorm0}."
f"Solver exceeded max iterations ({maxit}). Relative residual={rnorm / rnorm0}."
)

return _cg

0 comments on commit b265a9c

Please sign in to comment.