#10442: Tachyon fails on empty graphics objects
------------------------+---------------------------------------------------
Reporter: vbraun | Owner: jason, was
Type: defect | Status: new
Priority: major | Milestone:
Component: graphics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Comment(by novoselt):
I think this is the issue:
{{{
sage: (point([0,1,1])).show(viewer='tachyon')
}}}
works, while
{{{
sage: (point([0,1,1]) + Graphics()).show(viewer='tachyon')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_55.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("KHBvaW50KFswLDEsMV0pICsgR3JhcGhpY3MoKSkuc2hvdyh2aWV3ZXI9J3RhY2h5b24nKQ=="),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpEJzM5T/___code___.py", line 3, in <module>
exec compile(u"(point([_sage_const_0 ,_sage_const_1 ,_sage_const_1 ])
+ Graphics()).show(viewer='tachyon')" + '\n', '', 'single')
File "", line 1, in <module>
File "base.pyx", line 1081, in sage.plot.plot3d.base.Graphics3d.show
(sage/plot/plot3d/base.c:9834)
File "base.pyx", line 524, in sage.plot.plot3d.base.Graphics3d.tachyon
(sage/plot/plot3d/base.c:4743)
File "base.pyx", line 1410, in
sage.plot.plot3d.base.Graphics3dGroup.texture_set
(sage/plot/plot3d/base.c:13141)
File "base.pyx", line 1410, in
sage.plot.plot3d.base.Graphics3dGroup.texture_set
(sage/plot/plot3d/base.c:13141)
File "base.pyx", line 1410, in
sage.plot.plot3d.base.Graphics3dGroup.texture_set
(sage/plot/plot3d/base.c:13141)
File "base.pyx", line 1410, in
sage.plot.plot3d.base.Graphics3dGroup.texture_set
(sage/plot/plot3d/base.c:13157)
TypeError: reduce() of empty sequence with no initial value
}}}
In cones plotting of labels and rays was separated for the sake of non-
strictly convex cones (I assume that you have that patch applied, since in
plain sage-4.6 there are no problems, unless you add, say,
`ray_label=None` option). It may lead to addition of an empty graphics
object to the final plot. I do NOT consider it a bug of cones as I think
that empty plots are exactly what should be returned by plotting functions
if there is nothing to plot and viewers should handle it correctly, as
jmol and matplotlib do:
{{{
sage: (point([0,1,1]) + Graphics()).show(viewer='jmol')
sage: (point([0,1]) + Graphics()).show()
sage: (Graphics()).show()
}}}
All of these work as expected.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10442#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.