It might be an idea to perform doit() on UnevaluatedExpression classes while lambdifying. This removes the need to call doit() before creating a function, which is slow on large expressions (see #280).
Rough sketch:
class CustomNumPyPrinter(NumPyPrinter):
...
def _print_UnevaluatedExpression(self, expr, *args) -> str:
return self._print(expr.doit(deep=False))
Note that this might still leaves classes like CG unevaluated. So those will need to be evaluated (doit()) as well. The idea is the same as above, but this could be implemented with a decorator, just like _forward_to_numpy_printer().
It might be an idea to perform
doit()onUnevaluatedExpressionclasses while lambdifying. This removes the need to calldoit()before creating a function, which is slow on large expressions (see #280).Rough sketch:
Note that this might still leaves classes like
CGunevaluated. So those will need to be evaluated (doit()) as well. The idea is the same as above, but this could be implemented with a decorator, just like_forward_to_numpy_printer().