#18067: sage/graphs/graph.py: multigraph recognition in init fails
-------------------------------------+-------------------------------------
Reporter: darij | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.6
Component: graph theory | Resolution:
Keywords: graphs, sage- | Merged in:
combinat, | Reviewers:
Authors: Nathann Cohen | Work issues:
Report Upstream: N/A | Commit:
Branch: public/18067 | 04470691505336f5ce54b60569354d747fe80b76
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by darij):
I have nowhere near the expertise required to review this, but you have my
thanks. This is a courageous and overdue step towards cleaning up the
Augean stables of Sage's constructors.
Meanwhile, this:
{{{
if format is None and is_Matrix(data):
if data.is_square() and data == data.transpose():
format = 'adjacency_matrix'
else:
format = 'incidence_matrix'
msg += "Non-symmetric or non-square matrix assumed to be
an incidence matrix: "
}}}
is so ugly it is almost ridiculous. Good job improving the if-condition,
but IMHO the whole logic should go to hell. To drive the point home, maybe
add a doctest with the matrix
{{{
0 0 0 0 1 1
0 0 0 1 0 1
0 0 0 1 1 0
0 1 1 0 0 0
1 0 1 0 0 0
1 1 0 0 0 0
}}}
as either incidence or adjacency matrix.
--
Ticket URL: <http://trac.sagemath.org/ticket/18067#comment:11>
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.