Commits

Martin Alnæs committed c4a7ec1

Change dict comprehension to dict constructor.

  • Participants
  • Parent commits 237c10f

Comments (0)

Files changed (2)

File site-packages/uflacs/analysis/factorization.py

     # Extract argument component subgraph
     AV = [SV[j] for j in arg_indices]
     av2sv = arg_indices
-    sv2av = { j:i for i,j in enumerate(arg_indices) }
+    sv2av = dict( (j,i) for i,j in enumerate(arg_indices) )
     assert all(AV[i] == SV[j] for i,j in enumerate(arg_indices))
     assert all(AV[i] == SV[j] for j,i in sv2av.items())
 
     IM = F[-1]
 
     # Map argkeys from indices into SV to indices into AV
-    IM = { tuple(sv2av[j] for j in argkey): fi for argkey,fi in IM.items() }
+    IM = dict( (tuple(sv2av[j] for j in argkey), fi) for argkey,fi in IM.items() )
 
     # If this is a non-argument expression, point to the expression from IM (not sure if this is useful)
     if any([not AV, not IM, not arg_indices]):
     SV = []
     SV.extend(AV)
     SV.extend(FV)
-    se2i = { s: i for i, s in enumerate(SV) }
+    se2i = dict( (s, i) for i, s in enumerate(SV) )
 
     def add_vertex(h):
         # Avoid adding vertices twice

File site-packages/uflacs/backends/ffc/ffc_statement_formatter.py

         uflacs_assert(num_variables == 1, "Only single integrands implemented for ffc.")
 
         if self._idofs:
-            im = IndexMapping({ idof: idim for idof, idim in zip(self._idofs, self._argument_space_dimensions) })
+            im = IndexMapping(dict((idof, idim) for idof, idim in zip(self._idofs, self._argument_space_dimensions)))
             am = AxisMapping(im, [self._idofs])
             ii = am.format_access()
         else: