#14653: digraphs.Tournament(1) has 0 vertices
----------------------------+-----------------------------------------------
Reporter: rowland | Owner: jason, ncohen, rlm
Type: defect | Status: new
Priority: minor | Milestone: sage-5.10
Component: graph theory | Keywords: days47.5
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
----------------------------+-----------------------------------------------
{{{
sage: digraphs.Tournament(1)
Tournament on 1 vertices: Digraph on 0 vertices
sage: digraphs.Tournament(1).vertices()
[]
}}}
Causes the following.
{{{
sage: digraphs.Tournament(3) + digraphs.Tournament(1)
---------------------------------------------------------------------------
KeyError Traceback (most recent call
last)
<ipython-input-50-0b88bd757fb1> in <module>()
----> 1 digraphs.Tournament(Integer(3)) + digraphs.Tournament(Integer(1))
/Applications/sage/local/lib/python2.7/site-
packages/sage/graphs/generic_graph.pyc in __add__(self, other_graph)
363 """
364 if isinstance(other_graph, GenericGraph):
--> 365 return self.disjoint_union(other_graph,
verbose_relabel=False)
366
367 def __eq__(self, other):
/Applications/sage/local/lib/python2.7/site-
packages/sage/graphs/generic_graph.pyc in disjoint_union(self, other,
verbose_relabel)
13289 for v in other:
13290 r_other[v] = i; i += 1
> 13291 G = self.relabel(r_self,
inplace=False).union(other.relabel(r_other, inplace=False))
13292 elif any(u==v for u in self for v in other):
13293 r_self = dict([[v,(0,v)] for v in self])
/Applications/sage/local/lib/python2.7/site-
packages/sage/graphs/generic_graph.pyc in relabel(self, perm, inplace,
return_map, check_input, complete_partial_function)
16024 return_map= return_map,
16025 check_input = check_input,
> 16026 complete_partial_function =
complete_partial_function)
16027
16028 if return_map:
/Applications/sage/local/lib/python2.7/site-
packages/sage/graphs/generic_graph.pyc in relabel(self, perm, inplace,
return_map, check_input, complete_partial_function)
16096 new_attr = {}
16097 for v,value in getattr(self, attr).iteritems():
> 16098 new_attr[perm[v]] = value
16099
16100 setattr(self, attr, new_attr)
KeyError: 0
}}}
Found while implementing #14099
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14653>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.