Skip to content
Snippets Groups Projects
Commit 490ec914 authored by Richard Angersbach's avatar Richard Angersbach
Browse files

Omit old stuff from reduction_op_to_expr

parent 39483609
No related branches found
No related tags found
1 merge request!438Reduction Support
from .ast.expressions import PsExpression, PsCall, PsAdd, PsSub, PsMul, PsDiv
from .exceptions import FreezeError
from .exceptions import PsInternalCompilerError
from .functions import PsMathFunction, MathFunctions
from ..sympyextensions.reduction import ReductionOp
_available_operator_interface: set[ReductionOp] = {
ReductionOp.Add,
ReductionOp.Sub,
ReductionOp.Mul,
ReductionOp.Div,
}
def reduction_op_to_expr(op: ReductionOp, op1, op2) -> PsExpression:
match op:
case ReductionOp.Add:
......@@ -26,6 +18,6 @@ def reduction_op_to_expr(op: ReductionOp, op1, op2) -> PsExpression:
case ReductionOp.Max:
return PsCall(PsMathFunction(MathFunctions.Max), [op1, op2])
case _:
raise FreezeError(
raise PsInternalCompilerError(
f"Found unsupported operation type for reduction assignments: {op}."
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment