#6859 closed enhancement (fixed)
[with patch, positive review] Add more graph generators
Reported by: | myurko | Owned by: | rlm |
---|---|---|---|
Priority: | minor | Milestone: | sage-4.1.2 |
Component: | graph theory | Keywords: | |
Cc: | Merged in: | Sage 4.1.2.alpha4 | |
Authors: | Michael Yurko | Reviewers: | Jason Grout, Minh Van Nguyen |
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
This patch add graph generators for the hyper star, (n,k)-star, n-star, and bubble sort graph.
Attachments (6)
Change History (21)
Changed 12 years ago by
comment:1 Changed 12 years ago by
- Summary changed from Add more graph generators to [with patch, needs review] Add more graph generators
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Sure. I'll add definitions.
comment:4 Changed 12 years ago by
- Summary changed from [with patch, needs review] Add more graph generators to [with patch, needs work] Add more graph generators
I do not know if you are aware of it ( I was not until very recently ) but the docstrings are used to generate a very complete documentation accessible through there :
http://www.sagemath.org/doc/reference/graphs.html
This also means that you can use LaTeX in your description if you deem it necessary, and that the formula will be automatically translated into beautiful equations on this page ;-)
Nathann
comment:5 Changed 12 years ago by
Well, I knew that you can use Latex in docstrings, but I tried not to use it since it is hard to read when introspecting.
comment:6 Changed 12 years ago by
- Summary changed from [with patch, needs work] Add more graph generators to [with patch, needs review] Add more graph generators
comment:7 Changed 12 years ago by
Very nice.
I'm attaching a patch which optimizes some of the code to use more python things (like swapping), plus fixes a few typos. I think someone needs to review my patch.
comment:8 Changed 12 years ago by
I obviously can't review the patch, but the swapping certainly looks better. Coding too long in java has made forget some of the nice python idioms.
comment:9 Changed 12 years ago by
Okay, positive review for your patch.
You can review my changes (just make sure that you still get the same graphs). If you okay my changes, change this ticket to "positive review".
comment:10 Changed 12 years ago by
All the graphs except the n,k star graph worked still. However, it was just a one line fix to keep the v[0] = tmp_bit line inside the for loop (otherwise all the vertices become looped). I've uploaded a one line patch to fix it.
Changed 12 years ago by
comment:11 Changed 12 years ago by
- Summary changed from [with patch, needs review] Add more graph generators to [with patch, positive review] Add more graph generators
ah, right. Okay, then, positive review.
comment:12 Changed 12 years ago by
The patch trac_6859-ascii-chars.patch
uses only ASCII characters for quotation marks and long dashes. Without it, merging trac_6859.patch
and building the reference manual would result in the following error:
reading sources... sage/graphs/graph_generators /scratch/mvngu/release/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/Sphinx-0.5.1-py2.6.egg/sphinx/environment.py:543: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 raise SphinxError(err.message) Sphinx error:
comment:13 Changed 12 years ago by
The patch trac_6859-formatting-issues.patch
fixes formatting of lists. Without it, I get the following warnings when building the reference manual:
WARNING: /scratch/mvngu/release/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/sage/graphs/graph_generators.py:docstring of sage.graphs.graph_generators.GraphGenerators.HyperStarGraph:22: (WARNING/2) Bullet list ends without a blank line; unexpected unindent. WARNING: /scratch/mvngu/release/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/sage/graphs/graph_generators.py:docstring of sage.graphs.graph_generators.GraphGenerators.NKStarGraph:25: (WARNING/2) Bullet list ends without a blank line; unexpected unindent. WARNING: /scratch/mvngu/release/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/sage/graphs/graph_generators.py:docstring of sage.graphs.graph_generators.GraphGenerators.NStarGraph:19: (WARNING/2) Bullet list ends without a blank line; unexpected unindent.
comment:14 Changed 12 years ago by
- Merged in set to Sage 4.1.2.alpha3
- Resolution set to fixed
- Reviewers set to Jason Grout, Minh Van Nguyen
- Status changed from new to closed
Merged patches in this order:
trac_6859.patch
trac_6859-ascii-chars.patch
trac_6859_definitions.patch
trac-6859-optimize.patch
trac-6859-optimize-fix.patch
trac_6859-formatting-issues.patch
comment:15 Changed 12 years ago by
- Merged in changed from Sage 4.1.2.alpha3 to Sage 4.1.2.alpha4
There is no 4.1.2.alpha3. Sage 4.1.2.alpha3 was William Stein's release for working on making the notebook a standalone package.
Would it be possible to add to the docstrings the definition of what these graphs should be ?
Nathann