-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include David Perkinson's sandpile module in the sage library #10618
Comments
Attachment: sandpile-2.3.patch.gz adds module to graphs folder and the all.py in graphs |
comment:4
This applies fine to a clone of sage-4.6.1.rc1. However, it fails a ton of doctests. These might pass if the (optional/experimanetal) spkgs were installed. The point is, it should pass if nothing is installed. However, there were also these:
and
|
comment:5
Thanks for taking a look. I'll try to fix this up. I think the 4ti2 functions can be flagged "optional". |
comment:6
OK, all tests pass for me now and the coverage is 100%. The only problem that I see now is how to deal with namespace issues. I think classes like "Divisor" have too general a name to get imported into Sage at the top level, which is what this patch currently does. I see three alternatives at least:
themselves.
I would rank these as 1 > 2 > 3, but this is an important decision since it will be a pain to change later. |
comment:7
Replying to @sagetrac-mhampton:
Not for me:
This sort of failure occurs on both a 10.6.6 imac and an ubuntu machine.
I agree. I actually suggested this when David P was asking for suggestions |
Supersedes previous patch. |
comment:8
Attachment: trac_10618_sandpiles.patch.gz Sorry about that, I'm not sure how I missed that. I have tried once again, new patch has same name as the last one. |
comment:9
This installed and pases sage -testall on imac running 10.6.6 and sage-4.6.1.rc1. However, the instll of 4ti2 failed. I'll try it on a linux machine. |
comment:10
Replying to @wdjoyner:
To be more precise, the instuctions on installing 4ti2 given in the I'll report back on the results of running sage -testall -optional ASAP. |
comment:11
This looks good in the sense that the docstrings do not fail after 4ti2 (and glpk) is added. I am willing to give this a positive review. However, there are still some problems with the docstrings - (a) the naming issue mentioned above, (b) one date in the AUTHOR field has the wrong year, (c) the instructions on installing 4ti2 lead to the old package which does not install. Should these be fixed in a separate ticket? |
comment:12
No, I think we should get this pretty much right before it officially goes in - it would be annoying to change names later since we'd have to formally deprecate everything. I'll ask David Perkinson directly what he thinks about the namespace issues. |
Attachment: trac_10618_sandpiles.2.patch.gz |
comment:13
David Perkinson is OK with the idea of renaming some functions and classes to avoid confusion in the top namespace. The attached patch - trac_10618_sandpiles.2.patch - is a first attempt at resolving this aspect of the module. |
comment:14
Applying only trac_10618_sandpiles.2.patch to 4.6.1.rc0 on an ubuntu machine resulted in all tests passed in sage -testall. This is without 4ti2. I think you still need Also, I think you need to add to the intro of this ticket that only the last patch need be applied. |
Reviewer: David Joyner |
comment:17
The commit message of the patch should contain the ticket number. |
comment:18
I get various doctest failures:
|
This comment has been minimized.
This comment has been minimized.
comment:21
Installs fine to 4.7.a1 and passes sage -testall. |
comment:22
Again: you should change the commit message of the patch such that the first line mentions the ticket number. Use |
Work Issues: check "long time" |
comment:23
On which machine did you check where to write "# long time"? It seems that most of these "long time" doctests take less than 1 second on For example, this doctest on line 196::
Even though the test claims "minutes", in reality it takes about half a second. |
Apply only this patch. |
comment:24
Attachment: trac_10618_sandpiles.3.patch.gz I'm not sure why those used to take so much longer. Its possible that some changes in the Singular interface since then sped things up. Anyway, now testing everything without the 4ti2 dependencies takes abour 24 seconds on my laptop, and including the 4ti2 stuff it takes about 30 seconds. So I removed all the "long time" flags. I also put the ticket number on the commit message. |
comment:25
Installs fine to 4.7.a1 and passes sage -testall. Hope this stays as a positive review this time. Thanks again Marshall for creating this. |
Merged: sage-4.7.alpha2 |
Changed work issues from check "long time" to none |
comment:27
It seems that testing this module can give enormously different timings depending on the machine. Any clue why? On
But on my laptop (Gentoo Linux, Intel Core 2 Duo, gcc 4.4.3):
(i.e. it takes more than 360 seconds) |
comment:28
Please check the thread Something fishy with the |
Since David Perkinson's sandpile module (for studying the Abelian Sandpile Model; see for example: http://en.wikipedia.org/wiki/Bak-Tang-Wiesenfeld_sandpile or http://people.reed.edu/~davidp/sand/) is already written as a properly formatted Sage module it makes sense to include it in the Sage library.
This module involves a variety of mathematics so it is added in its own module.
Some parts of the module require 4ti2, currently an experimental package (but there is no reason it can't be at least an optional package), but this can be explained in the relevant docstrings. Currently the 4ti2 package at:
http://sage.math.washington.edu/home/mhampton/4ti2-1.3.2.p1.spkg
is best to use.
In case any mathematical justification is needed, this model is of considerable and rising interest. For example, at the joint math meetings in 2011 there was a talk by Yuval Peres of Microsoft Research surveying it: http://www.ams.org/amsmtgs/2125_abstracts/1067-a0-38.pdf.
Only apply:
trac_10618_sandpiles.3.patch
CC: @sagetrac-dperkinson @wdjoyner @dandrake
Component: graph theory
Keywords: abelian sandpile model
Author: David Perkinson, Marshall Hampton
Reviewer: David Joyner
Merged: sage-4.7.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/10618
The text was updated successfully, but these errors were encountered: