# loki.expression.evaluation module

class LokiEvaluationMapper(strict=False, **kwargs)

  Bases: `EvaluationMapper`

  A mapper for evaluating expressions, based on `pymbolic.mapper.evaluator.EvaluationMapper`.

  Parameters:

    strict (bool) – Raise exception for unknown symbols/expressions (default: False).

  static case_insensitive_getattr(obj, attr)

    Case-insensitive version of getattr.

  map_comparison(expr)
  map_logical_and(expr)
  map_logic_literal(expr)
  map_float_literal(expr)
  map_int_literal(expr)
  map_variable(expr)
  map_array(expr)
  map_call(expr, name=None, parameters=None)
  map_inline_call(expr)

eval_expr(expr, context=None, strict=False)

  Call Loki Evaluation Mapper to evaluate expression(s).

  Parameters:

    - expr (`Expression`) – The expression as a string

    - strict (bool, optional) – Whether to raise exception for unknown variables/symbols when evaluating an expression (default: False)

    - context (dict, optional) – Symbol context, defining variables/symbols/procedures to help/support evaluating an expression

  Returns:

    The evaluated expression tree corresponding to the expression

  Return type:

    `Expression`