diff --git a/dagrt/codegen/python.py b/dagrt/codegen/python.py index 0d1cd1e29ab59b972de51d7e8ed5f29e8649b31b..a749e0e1985084cfbb65e56c8d19ab40563d5013 100644 --- a/dagrt/codegen/python.py +++ b/dagrt/codegen/python.py @@ -445,8 +445,7 @@ class CodeGenerator(StructuredCodeGenerator): else: assign_code = ( ", ".join(self._name_manager[n] for n in inst.assignees) - + - " = ") + + " = ") from pymbolic import var self._emit( diff --git a/dagrt/codegen/transform.py b/dagrt/codegen/transform.py index 578a8cfcb4c71b5c9e378da2b46db63b25af7d7c..ea8831e26fca4584860b0f6d75ff19cf47204f6d 100644 --- a/dagrt/codegen/transform.py +++ b/dagrt/codegen/transform.py @@ -336,16 +336,20 @@ class IfThenElseExpander(IdentityMapper): expression=rec_then, id=then_stmt_id, depends_on=( - base_deps | frozenset(sub_then_deps) | - frozenset([if_stmt_id]))), + base_deps + | frozenset(sub_then_deps) + | frozenset([if_stmt_id]))), AssignExpression( assignee=tmp_result, assignee_subscript=(), condition=else_condition, expression=rec_else, id=else_stmt_id, - depends_on=base_deps | frozenset(sub_else_deps) | - frozenset([if_stmt_id]))]) + depends_on=( + base_deps + | frozenset(sub_else_deps) + | frozenset([if_stmt_id]))) + ]) extra_deps.extend([then_stmt_id, else_stmt_id]) return var(tmp_result) diff --git a/dagrt/expression.py b/dagrt/expression.py index 9c3b83e7e6e8943863ff16bb5c7323ef321eb252..24b97ccde650ac2d1ef65bd59da65de748ca2f4f 100644 --- a/dagrt/expression.py +++ b/dagrt/expression.py @@ -294,8 +294,8 @@ class _ExtendedUnifier(UnidirectionalUnifier): variables = set( term for term in expr.children - if isinstance(term, Variable) and - term.name in self.lhs_mapping_candidates) + if isinstance(term, Variable) + and term.name in self.lhs_mapping_candidates) from pymbolic.mapper.unifier import unify_many diff --git a/dagrt/language.py b/dagrt/language.py index 307d51a7ed5123fa09159bbe62dec90310344c91..a5d3ca88f6d01033e1f09285a62d3bf34b578a73 100644 --- a/dagrt/language.py +++ b/dagrt/language.py @@ -1067,8 +1067,9 @@ class CodeBuilder(object): # Warn about potential ordering of assignments that may # be unexpected by the user. if assignee in context.used_variables: - raise ValueError("write after use of " + assignee + - " in the same block") + raise ValueError( + "write after use of " + assignee + + " in the same block") if ( assignee in context.definition_map diff --git a/dagrt/utils.py b/dagrt/utils.py index e0ddb55666b34ec063a361bde30002164349ccc3..bda471464a86b83f579aaa8b57468dfdd3cba771 100644 --- a/dagrt/utils.py +++ b/dagrt/utils.py @@ -213,8 +213,9 @@ def run_fortran(sources, fortran_options=None): file=sys.stderr) if stderr_data: - raise RuntimeError("Fortran code has non-empty stderr:\n" + - stderr_data.decode('ascii')) + raise RuntimeError( + "Fortran code has non-empty stderr:\n" + + stderr_data.decode('ascii')) return p.returncode, stdout_data, stderr_data