diff --git a/pystencils/transformations.py b/pystencils/transformations.py index 515f05794e6982d60a67a5d6d41b4b36ca3ce71b..6e84dcfc97ec3aa14ded4bc0cd74938eb77b3baf 100644 --- a/pystencils/transformations.py +++ b/pystencils/transformations.py @@ -8,9 +8,6 @@ from types import MappingProxyType import sympy as sp import pystencils.astnodes as ast -from pystencils.astnodes import Conditional - -from pystencils.astnodes import ResolvedFieldAccess from pystencils.assignment import Assignment from pystencils.typing import (CastFunc, PointerType, StructType, TypedSymbol, get_base_type, ReinterpretCastFunc, get_next_parent_of_type, parents_of_type) @@ -633,7 +630,7 @@ def move_constants_before_loop(ast_node, rename_moved_consts = False): block.append(child) continue - if isinstance(child, ast.SympyAssignment) and isinstance(child.lhs, ResolvedFieldAccess): # don't move field accesses + if isinstance(child, ast.SympyAssignment) and isinstance(child.lhs, ast.ResolvedFieldAccess): # don't move field accesses block.append(child) continue @@ -776,7 +773,7 @@ def cut_loop(loop_node, cutting_points, with_conditional: bool = False): new_body.subs({loop_node.loop_counter_symbol: new_start}) if with_conditional: conditional_expr = sp.And(sp.Ge(new_start, loop_node.start), sp.Le(new_start, loop_node.stop)) - new_loops.append(Conditional(conditional_expr, new_body)) + new_loops.append(ast.Conditional(conditional_expr, new_body)) else: new_loops.append(new_body) elif new_end - new_start == 0: