#10442: Tachyon fails on empty graphics objects
----------------------------+--------------------------
       Reporter:  vbraun    |        Owner:  jason, was
           Type:  defect    |       Status:  new
       Priority:  major     |    Milestone:
      Component:  graphics  |   Resolution:
       Keywords:            |    Merged in:
        Authors:            |    Reviewers:
Report Upstream:  N/A       |  Work issues:
         Branch:            |       Commit:
   Dependencies:            |     Stopgaps:
----------------------------+--------------------------

Comment (by tcoffee):

 This looks to me like an easy fix.

 In 6.1.1, the Graphics3dGroup.texture_set() method is defined by line
 sage/plot/plot3d/base.pyx:1501:

 {{{
 return reduce(set.union, [g.texture_set() for g in self.all])
 }}}

 It chokes on empty graphics because reduce() chokes on an empty list.
 Adding an initializer resolves the issue:

 {{{
 return reduce(set.union, [g.texture_set() for g in self.all], set())
 }}}

 Being in a hurry at the moment, I just used an external workaround:

 {{{
     def texture_set(g):
         try:
             return g.texture_set()
         except TypeError:
             return reduce(set.union, [texture_set(gi) for gi in g.all],
 set())
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/10442#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to