Skip to content

Commit cc18063

Browse files
Apply suggestions from code review
Co-authored-by: Connor Ward <[email protected]>
1 parent ea5c07b commit cc18063

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

firedrake/interpolation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,10 @@ def __init__(self, expr, v,
101101

102102
V = v.arguments()[0].function_space()
103103
if len(expr.ufl_shape) != len(V.value_shape):
104-
raise RuntimeError('Rank mismatch: Expression rank %d, FunctionSpace rank %d'
105-
% (len(expr.ufl_shape), len(V.value_shape)))
104+
raise RuntimeError(f'Rank mismatch: Expression rank {len(expr.ufl_shape)}, FunctionSpace rank {len(V.value_shape)}')
106105

107106
if expr.ufl_shape != V.value_shape:
108-
raise RuntimeError('Shape mismatch: Expression shape %r, FunctionSpace shape %r'
109-
% (expr.ufl_shape, V.value_shape))
107+
raise RuntimeError('Shape mismatch: Expression shape {expr.ufl_shape}, FunctionSpace shape {V.value_shape}')
110108
super().__init__(expr, v)
111109

112110
# -- Interpolate data (e.g. `subset` or `access`) -- #

0 commit comments

Comments
 (0)