Opened 10 years ago
Closed 10 years ago
#10932 closed defect (fixed)
Fix typo in the multiple edges detection code of DiGraph
Reported by: | nthiery | Owned by: | jason, ncohen, rlm |
---|---|---|---|
Priority: | major | Milestone: | sage-4.7 |
Component: | graph theory | Keywords: | |
Cc: | ncohen | Merged in: | sage-4.7.alpha2 |
Authors: | Nicolas M. Thiéry | Reviewers: | Nathann Cohen |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
sage: DiGraph([(1, 2, 0), (1,2,1)]) Traceback (most recent call last): ... File "/opt/sage-4.6.2/local/lib/python2.6/site-packages/sage/graphs/digraph.py", line 417, in __init__ (u in data[v])): KeyError: 2 sage: DiGraph([(1, 2, 0)]) ------------------------------------------------------------ Traceback (most recent call last): ... File "/opt/sage-4.6.2/local/lib/python2.6/site-packages/sage/graphs/digraph.py", line 417, in __init__ (u in data[v])): KeyError: 2
The test should have been v in data[u]. I'll attach soon a patch doing this:
sage: DiGraph([(1, 2, 0), (1,2,1)]) Multi-digraph on 2 vertices sage: DiGraph([(1, 2, 0)]) Digraph on 2 vertices
Attachments (1)
Change History (8)
Changed 10 years ago by
comment:1 Changed 10 years ago by
- Status changed from new to needs_review
comment:2 Changed 10 years ago by
- Description modified (diff)
comment:3 follow-up: ↓ 4 Changed 10 years ago by
- Status changed from needs_review to positive_review
I thought there would be a similar problem in graph.py, but the situation there is obviously more... symmetric :-)
Nathann
comment:4 in reply to: ↑ 3 Changed 10 years ago by
Replying to ncohen:
I thought there would be a similar problem in graph.py, but the situation there is obviously more... symmetric
:-)
Nathann
Thanks for the review!
comment:5 Changed 10 years ago by
- Milestone set to sage-4.7
comment:6 Changed 10 years ago by
- Reviewers set to Nathann Cohen
comment:7 Changed 10 years ago by
- Merged in set to sage-4.7.alpha2
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Btw: pyflakes complains about
choice
not being defined on l. 602 of this file. But I leave that to someone else to investigate this further.