diff --git a/python/dune/perftool/pdelab/driver.py b/python/dune/perftool/pdelab/driver.py
index 548d6c08ce88c198c86a135760b794023f8a9704..62a72fcea2c6ebc82596be76fa17f1d4d19dc15c 100644
--- a/python/dune/perftool/pdelab/driver.py
+++ b/python/dune/perftool/pdelab/driver.py
@@ -786,6 +786,7 @@ def define_boundary_lambda(boundary, name):
 
     raise ValueError("Expression not understood")
 
+
 def name_boundary_lambda(boundary, name):
     define_boundary_lambda(boundary, name + "lambda")
     return name + "lambda"
diff --git a/python/dune/perftool/pdelab/geometry.py b/python/dune/perftool/pdelab/geometry.py
index 1abc8bf3627f539fed2b44439fa9201454dc0767..b66f58fc875370737ec9a9d267b53acedcb1efe6 100644
--- a/python/dune/perftool/pdelab/geometry.py
+++ b/python/dune/perftool/pdelab/geometry.py
@@ -399,6 +399,7 @@ def apply_to_global_transformation(name, local):
                                depends_on=frozenset({Writes(get_pymbolic_basename(local))})
                                )
 
+
 def to_global(local):
     assert isinstance(local, prim.Expression)
     name = get_pymbolic_basename(local) + "_global"
diff --git a/python/dune/perftool/sumfact/basis.py b/python/dune/perftool/sumfact/basis.py
index 86a9b354efa1d1b6bc07d90edc45b8c531ff577c..3c04cd09b7b4e97005ef90f0eab8e3a640522054 100644
--- a/python/dune/perftool/sumfact/basis.py
+++ b/python/dune/perftool/sumfact/basis.py
@@ -46,7 +46,6 @@ from loopy.match import Writes
 import pymbolic.primitives as prim
 
 
-
 def name_sumfact_base_buffer():
     count = get_counter('sumfact_base_buffer')
     name = "buffer_{}".format(str(count))
diff --git a/python/dune/perftool/sumfact/sumfact.py b/python/dune/perftool/sumfact/sumfact.py
index 2429da4ef3d688ebe651f7d4de140ca76a8a779a..35d91cc0d553f803988c8c6e932aed18144c6337 100644
--- a/python/dune/perftool/sumfact/sumfact.py
+++ b/python/dune/perftool/sumfact/sumfact.py
@@ -251,12 +251,12 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
         # variable.
         if get_option('fastdg'):
             ft = get_global_context_value("form_type")
-            if ft=='residual':
+            if ft == 'residual':
                 accum = accum + ".data()"
                 size = basis_functions_per_direction() ** world_dimension()
                 globalarg(accum, dtype=np.float64, shape=(size,), managed=False)
                 assignee = prim.Subscript(prim.Variable(accum), (test_lfs.index,))
-                expression = prim.Sum((assignee,result))
+                expression = prim.Sum((assignee, result))
                 instruction(assignee=assignee,
                             expression=expression,
                             forced_iname_deps=frozenset(inames),
@@ -264,12 +264,12 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
                             depends_on=insn_dep,
                             )
             else:
-                assert ft=='jacobian'
+                assert ft == 'jacobian'
                 accum = accum + ".data()"
                 size = basis_functions_per_direction() ** world_dimension()
                 globalarg(accum, dtype=np.float64, shape=(size, size), managed=True)
                 assignee = prim.Subscript(prim.Variable(accum), (ansatz_lfs.index, test_lfs.index))
-                expression = prim.Sum((assignee,result))
+                expression = prim.Sum((assignee, result))
                 instruction(assignee=assignee,
                             expression=expression,
                             forced_iname_deps=frozenset(inames + visitor.inames),
@@ -282,15 +282,14 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
                         (ansatz_lfs.get_args() +
                          test_lfs.get_args() +
                          (result,)
+                         )
                         )
-            )
             instruction(assignees=(),
                         expression=expr,
                         forced_iname_deps=frozenset(inames + visitor.inames + vecinames),
                         forced_iname_deps_is_final=True,
                         depends_on=insn_dep,
-            )
-
+                        )
 
         # Mark the transformation that moves the quadrature loop inside the trialfunction loops for application
         transform(nest_quadrature_loops, visitor.inames)
@@ -384,7 +383,7 @@ def sum_factorization_kernel(a_matrices,
         # * an input temporary (default)
         # * a global data structure (if FastDGGridOperator is in use)
         # * a value from a global data structure, broadcasted to a vector type (vectorized + FastDGGridOperator)
-        if l==0 and direct_input is not None:
+        if l == 0 and direct_input is not None:
             globalarg(direct_input, dtype=np.float64, shape=inp_shape)
             if a_matrix.vectorized:
                 input_summand = prim.Call(prim.Variable("Vec4d"), (prim.Subscript(prim.Variable(direct_input),
diff --git a/python/dune/perftool/ufl/visitor.py b/python/dune/perftool/ufl/visitor.py
index 14e83916eaf4223bf13ff1dfb5574b8478581de5..f8129bf225c12f80bd0df0a546eb2a27189df129 100644
--- a/python/dune/perftool/ufl/visitor.py
+++ b/python/dune/perftool/ufl/visitor.py
@@ -270,32 +270,32 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
     def eq(self, o):
         return prim.Comparison(self.call(o.ufl_operands[0]),
                                "==",
-                               right = self.call(o.ufl_operands[1]))
+                               right=self.call(o.ufl_operands[1]))
 
     def ge(self, o):
         return prim.Comparison(self.call(o.ufl_operands[0]),
                                ">=",
-                               right = self.call(o.ufl_operands[1]))
+                               right=self.call(o.ufl_operands[1]))
 
     def gt(self, o):
         return prim.Comparison(self.call(o.ufl_operands[0]),
                                ">",
-                               right = self.call(o.ufl_operands[1]))
+                               right=self.call(o.ufl_operands[1]))
 
     def le(self, o):
         return prim.Comparison(self.call(o.ufl_operands[0]),
                                "<=",
-                               right = self.call(o.ufl_operands[1]))
+                               right=self.call(o.ufl_operands[1]))
 
     def lt(self, o):
         return prim.Comparison(self.call(o.ufl_operands[0]),
                                "<",
-                               right = self.call(o.ufl_operands[1]))
+                               right=self.call(o.ufl_operands[1]))
 
     def ne(self, o):
         return prim.Comparison(self.call(o.ufl_operands[0]),
                                "!=",
-                               right = self.call(o.ufl_operands[1]))
+                               right=self.call(o.ufl_operands[1]))
 
     def and_condition(self, o):
         return prim.LogicalAnd((self.call(o.ufl_operands[0]), self.call(o.ufl_operands[1])))