Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
sage.plot: Remove use of is_CallableSymbolicExpression, is_SymbolicEq…
Browse files Browse the repository at this point in the history
…uation
  • Loading branch information
Matthias Koeppe committed Oct 17, 2021
1 parent 37da733 commit 80a8f9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/sage/plot/contour_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@ def f(x,y):
...
ValueError: only one of color or rgbcolor should be specified
"""
from sage.symbolic.expression import is_SymbolicEquation
if is_SymbolicEquation(f):
from sage.structure.element import Expression
if isinstance(f, Expression) and f.is_relational():
if f.operator() != operator.eq:
raise ValueError("input to implicit plot must be function "
"or equation")
Expand Down
6 changes: 2 additions & 4 deletions src/sage/plot/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from sage.ext.fast_eval import fast_float

from sage.structure.element import is_Vector
from sage.structure.element import is_Vector, Expression

def setup_for_eval_on_grid(funcs, ranges, plot_points=None, return_vars=False):
"""
Expand Down Expand Up @@ -187,15 +187,13 @@ def unify_arguments(funcs):
sage: sage.plot.misc.unify_arguments((x+y,x-y))
((x, y), (x, y))
"""
from sage.symbolic.callable import is_CallableSymbolicExpression

vars=set()
free_variables=set()
if not isinstance(funcs, (list, tuple)):
funcs = [funcs]

for f in funcs:
if is_CallableSymbolicExpression(f):
if isinstance(f, Expression) and f.is_callable():
f_args = set(f.arguments())
vars.update(f_args)
else:
Expand Down
6 changes: 3 additions & 3 deletions src/sage/plot/plot3d/plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,13 +1046,13 @@ def plot3d(f, urange, vrange, adaptive=False, transformation=None, **kwds):
Graphics3d Object
"""
if transformation is not None:
params=None
from sage.symbolic.callable import is_CallableSymbolicExpression
params = None
from sage.structure.element import Expression
# First, determine the parameters for f (from the first item of urange
# and vrange, preferably).
if len(urange) == 3 and len(vrange) == 3:
params = (urange[0], vrange[0])
elif is_CallableSymbolicExpression(f):
elif isinstance(f, Expression) and f.is_callable():
params = f.variables()

from sage.modules.vector_callable_symbolic_dense import Vector_callable_symbolic_dense
Expand Down

0 comments on commit 80a8f9e

Please sign in to comment.