From 555a6a836408071ca32c705bdf0fdf5e5e610437 Mon Sep 17 00:00:00 2001 From: zy69guqi <richard.angersbach@fau.de> Date: Thu, 16 Jan 2025 16:15:24 +0100 Subject: [PATCH] Reformat reduction.py --- src/pystencils/sympyextensions/reduction.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pystencils/sympyextensions/reduction.py b/src/pystencils/sympyextensions/reduction.py index e2760cc6c..c9e5bfdfb 100644 --- a/src/pystencils/sympyextensions/reduction.py +++ b/src/pystencils/sympyextensions/reduction.py @@ -12,7 +12,7 @@ class ReducedAssignment(AssignmentBase): Symbol for binary operation being applied in the assignment, such as "+", "*", etc. """ - binop = None # type: str + binop = None # type: str @property def op(self): @@ -22,6 +22,7 @@ class ReducedAssignment(AssignmentBase): class AddReducedAssignment(ReducedAssignment): binop = '+' + class SubReducedAssignment(ReducedAssignment): binop = '-' @@ -33,6 +34,7 @@ class MulReducedAssignment(ReducedAssignment): class MinReducedssignment(ReducedAssignment): binop = 'min' + class MaxReducedssignment(ReducedAssignment): binop = 'max' @@ -45,7 +47,8 @@ reduced_assign_classes = { ] } + def reduced_assign(lhs, op, rhs): if op not in reduced_assign_classes: raise ValueError("Unrecognized operator %s" % op) - return reduced_assign_classes[op](lhs, rhs) \ No newline at end of file + return reduced_assign_classes[op](lhs, rhs) -- GitLab