From fe0c90f61e3a01bab577516439b20ba10bc9c57e Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 28 Oct 2018 13:55:06 -0500 Subject: [PATCH] Placate flake8 3.6 --- dagrt/codegen/python.py | 3 +-- dagrt/codegen/transform.py | 12 ++++++++---- dagrt/expression.py | 4 ++-- dagrt/language.py | 5 +++-- dagrt/utils.py | 5 +++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dagrt/codegen/python.py b/dagrt/codegen/python.py index 0d1cd1e..a749e0e 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 578a8cf..ea8831e 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 9c3b83e..24b97cc 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 307d51a..a5d3ca8 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 e0ddb55..bda4714 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 -- GitLab