-
-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #8450: intermediate complex expression in real functions make ma…
…ny plot functions fail All of the following plots fail {{{ x, y = SR.var('x y') contour_plot(abs(x+i*y), (x,-1,1), (y,-1,1)) density_plot(abs(x+i*y), (x,-1,1), (y,-1,1)) plot3d(abs(x+i*y), (x,-1,1),(y,-1,1)) streamline_plot(abs(x+i*y), (x,-1,1),(y,-1,1)) }}} with {{{ TypeError: unable to coerce to a real number }}} The culprit is the call to `setup_for_eval_on_grid` (from `sage/plot/misc.py`) that tries to compile the symbolic expression with `fast_float`. But since the expression involves an intermediate complex number the compilation fails. This can be tested with any of the two {{{ fast_float(abs(x + i*y), x, y) fast_callable(abs(x + i*y), vars=[x,y]) }}} The function compilation succeeds if we ask for a complex function instead {{{ fast_callable(abs(x + i*y), vars=[x,y], domain=complex) }}} See also [https://ask.sagemath.org/question/46275/typeerror-unable-to- coerce-to-a-real-number/ this question on ask.sagemath.org]. URL: https://trac.sagemath.org/8450 Reported by: jason Ticket author(s): Michael Orlitzky Reviewer(s): Dima Pasechnik
- Loading branch information
Showing
5 changed files
with
325 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.