#9362: Invalidate None as a vertex label.
-------------------------------+--------------------------------------------
Reporter: boothby | Owner: jason, mvngu, ncohen, rlm
Type: defect | Status: positive_review
Priority: major | Milestone: sage-pending
Component: graph theory | Keywords: sd35.5
Work_issues: | Upstream: N/A
Reviewer: Paul Zimmermann | Author: Lukáš Lánský
Merged: | Dependencies: #11739
-------------------------------+--------------------------------------------
Changes (by zimmerma):
* status: needs_review => positive_review
Old description:
> The following indicates to me a huge problem:
>
> {{{
> sage: G = Graph()
> sage: G.add_edge(None, 1)
> sage: G.show()
> }}}
>
> the resulting plot has three vertices, one blank, one labeled "1" and the
> other labeled "None". The blank vertex is floating off in space, and the
> None and 1 vertices are bunched together.
>
> Other places where a vertex labeled None will obviously cause problems:
>
> {{{spanning_trees_count}}}, {{{add_vertex}}}, {{{add_edge}}},
> {{{delete_edge}}}, {{{has_edge}}}, {{{edge_label}}}, {{{eccentricity}}},
> {{{layout_tree}}}
>
> this is not an exhaustive list; I merely read method definitions to look
> where a vertex argument defaults to None (and later uses the condition
> {{{if v is None}}}).
>
> This indicates to me that we should not accept "None" as a valid vertex
> label.
New description:
The following indicates to me a huge problem:
{{{
sage: G = Graph()
sage: G.add_edge(None, 1)
sage: G.show()
}}}
the resulting plot has three vertices, one blank, one labeled "1" and the
other labeled "None". The blank vertex is floating off in space, and the
None and 1 vertices are bunched together.
Other places where a vertex labeled None will obviously cause problems:
{{{spanning_trees_count}}}, {{{add_vertex}}}, {{{add_edge}}},
{{{delete_edge}}}, {{{has_edge}}}, {{{edge_label}}}, {{{eccentricity}}},
{{{layout_tree}}}
this is not an exhaustive list; I merely read method definitions to look
where a vertex argument defaults to None (and later uses the condition
{{{if v is None}}}).
This indicates to me that we should not accept "None" as a valid vertex
label.
Apply [attachment:trac_9362_None_is_no_name.2.patch] only.
--
Comment:
positive review, all doctests still pass with Sage 4.8 (except a timeout
in
{{{sandpiles/sandpile.py}}} which already happened before this patch).
Paul
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9362#comment:15>
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.