Skip to content

Commit

Permalink
Un-type symbolic.flatten
Browse files Browse the repository at this point in the history
This restores compatibility with pymbolic 2022.2

x-ref: firedrakeproject/loopy#27
  • Loading branch information
inducer committed Nov 6, 2024
1 parent 7ac9fa6 commit fab073b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions loopy/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import pymbolic.primitives as p
import pytools.lex
from islpy import dim_type
from pymbolic import ArithmeticExpressionT
from pymbolic.mapper import (
CachedCombineMapper as CombineMapperBase,
CachedIdentityMapper as IdentityMapperBase,
Expand Down Expand Up @@ -211,14 +210,8 @@ class FlattenMapper(FlattenMapperBase, IdentityMapperMixin):
pass


ArithmeticOrExpressionT = TypeVar(
"ArithmeticOrExpressionT",
ArithmeticExpressionT,
ExpressionT)


def flatten(expr: ArithmeticOrExpressionT) -> ArithmeticOrExpressionT:
return cast(ArithmeticOrExpressionT, FlattenMapper()(expr))
def flatten(expr):
return FlattenMapper()(expr)


class IdentityMapper(IdentityMapperBase, IdentityMapperMixin):
Expand Down

0 comments on commit fab073b

Please sign in to comment.