I wrote a class with a __call__ method, and I want to plot an instance of it using plot() in the sage notebook. I run the commands:
*****************************************
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_32.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGxvdChoLCB4bWluPTAsIHhtYXg9MSk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpnBGA3K/___code___.py", line 3, in <module>
exec compile(u'plot(h, xmin=_sage_const_0 , xmax=_sage_const_1 )
File "", line 1, in <module>
File "/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 692, in wrapper
return func(*args, **kwds)
File "/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 537, in wrapper
return func(*args, **options)
File "/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1130, in plot
G = _plot(funcs, (xmin, xmax), **kwds)
File "/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1236, in _plot
funcs, ranges = setup_for_eval_on_grid(funcs, [xrange], options['plot_points'])
File "/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/misc.py", line 148, in setup_for_eval_on_grid
return fast_float(funcs, *vars,**options), [tuple(range+[range_step]) for range,range_step in zip(ranges, range_steps)]
File "fast_eval.pyx", line 1377, in sage.ext.fast_eval.fast_float (sage/ext/fast_eval.c:9718)
AttributeError: EquivariantRHomeo instance has no attribute '__float__'
That works fine. Is there something I need to do to the class to convince plot() to call it?