#10207: Sage silently fails when passing wrong side for cayley_graph
------------------------------+---------------------------------------------
   Reporter:  hivert          |       Owner:  hivert      
       Type:  defect          |      Status:  new         
   Priority:  major           |   Milestone:  sage-4.6.1  
  Component:  group theory    |    Keywords:  Cayley graph
     Author:  Florent Hivert  |    Upstream:  N/A         
   Reviewer:                  |      Merged:              
Work_issues:                  |  
------------------------------+---------------------------------------------
 The following is expected
 {{{
 sage: S2 = SymmetricGroup(2)
 sage: G = S2.cayley_graph()
 sage: G.edges()
 [((), (1,2), 1), ((1,2), (), 1)]
 sage: G = S2.cayley_graph(side="twosided")
 sage: G.edges()
 [((), (1,2), (1, 'right')), ((1,2), (), (1, 'right'))]
 }}}
 However if a wrong parameter is given to side, a graph with no edges is
 returned rather than raising an error:
 {{{
 sage: G = S2.cayley_graph(side="both")
 sage: G.edges()
 []
 }}}
 After the patch
 {{{
 sage: S2 = SymmetricGroup(2)
 sage: G = S2.cayley_graph(side="both")
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/florent/LITIS/<ipython console> in <module>()

 /home/florent/src/Sage/sage/local/lib/python2.6/site-
 packages/sage/categories/semigroups.pyc in cayley_graph(self, side,
 simple, elements, generators, connecting_set)
     272             from groups import Groups
     273             if not side in ["left", "right", "twosided"]:
 --> 274                 raise ValueError, "option 'side' must be 'left',
 'right' or 'twosided'"
     275             if elements is None:
     276                 assert self.is_finite(), "elements should be
 specified for infinite semigroups"

 ValueError: option 'side' must be 'left', 'right' or 'twosided'
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10207>
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.

Reply via email to