Opened 2 years ago
Closed 2 years ago
#26803 closed defect (fixed)
Error message in szeged_index()
Reported by: | jmantysalo | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.5 |
Component: | graph theory | Keywords: | |
Cc: | Merged in: | ||
Authors: | David Coudert | Reviewers: | Jori Mäntysalo |
Report Upstream: | N/A | Work issues: | |
Branch: | 9e3a4d8 (Commits, GitHub, GitLab) | Commit: | 9e3a4d820c033cc598521579bbed5261f45407ef |
Dependencies: | Stopgaps: |
Description
Graph({0: [1], 2: []}).szeged_index()
gives KeyError: 2
. No idea about what is Szeged index, but anyways at least the error message should be better.
Change History (6)
comment:1 Changed 2 years ago by
- Branch set to public/26803_fix_szeged_index
- Commit set to da3b48f209e6da3df7fdb96ef8a670f0de2d0aa1
- Status changed from new to needs_review
comment:2 Changed 2 years ago by
- Reviewers set to Jori Mäntysalo
- Status changed from needs_review to needs_work
Seems good, but test for a ticket should go to TESTS::
section instead of EXAMPLES::
.
comment:3 Changed 2 years ago by
- Commit changed from da3b48f209e6da3df7fdb96ef8a670f0de2d0aa1 to 9e3a4d820c033cc598521579bbed5261f45407ef
Branch pushed to git repo; I updated commit sha1. New commits:
9e3a4d8 | trac #26803: add TESTS block
|
comment:6 Changed 2 years ago by
- Branch changed from public/26803_fix_szeged_index to 9e3a4d820c033cc598521579bbed5261f45407ef
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
According to https://en.wikipedia.org/wiki/Szeged_index, this index is defined for connected graphs only.
I added a test and a doctest, a link to the wikipedia page for easier access to definition, and took the opportunity to do PEP8 cleaning of this method.
New commits:
trac #26803: fix and clean
trac #26803: add wikipedia link