Skip to content

Add own implementation for printing an unknown function

Stephan Seitz requested to merge seitz/pystencils:function-call-printing into master

Using the SymPy implementation for printing a sympy.Function has some issues:

  • you cannot use cast_func as an argument -> SymPy prints `cast_func(2,float)
  • typed numbers are not typed any more -> e.g. pow(x, 0.25) instead of pow(x, 0.25f)

Maybe a disadvantage or an advantage:

  • arbitrary Functions: sympy.Function('my_function') are now allowed.

Would have prevented commits like:

Fix: type of sqrt(int) was int not floating point type

Edited by Stephan Seitz

Merge request reports