Lecture 13: Overview of Sage Development

Motivating Problem: Suppose you want to modify or improve Sage in some way, and want your changes to be included in a future release of Sage.  How do you do this?

{{{id=2| /// }}}

Example: Sage-4.6.2

Here is the changelog for Sage-4.6.2, which is the most recent release (as of April 25, 2011):

http://sagemath.org/mirror/src/changelogs/sage-4.6.2.txt

Notice:

Each ticket is listed after a number.  You can lookup everything relevant to that ticket at http://trac.sagemath.org/sage_trac  (#number in the search box in the upper right).  

(Choose an example or two at random and look at it, e.g., 10336.)

  1. This is an enhancement, not a bug fix, with code by a Russian grad student in Canada (who used to be a UW grad student).
  2. The patch was posted 5 months ago.
  3. Little improvements... vbraun (postdoc in Ireland) gives a positive review.
  4. Merged into Sage (3 months ago) by jdemeyer (postdoc in Belgium).

 

{{{id=6| /// }}}

Some hurdles to getting your code into Sage:

 

  1. You have to use the command line (it is not possible to use only the notebook for Sage development... yet!)
  2. You pretty much have to know basic UNIX commands (e.g.,: ls, cp, cd, mv, etc.)
  3. You have to have some understanding of the Sage library and our coding conventions and requirements.
  4. You have to submit patches to the trac webpage, which requires using the Mercurial distributed revision control system
  5. All patches go through peer review (like a published paper) -- somebody has to referee them and sign off on them before they can go into Sage. 

Fortunately, the process is well documented (see http://sagemath.org/doc/developer/), there are thousands of examples of tickets getting reviewed at http://trac.sagemath.org/, and there are numerous Sage Days workshops that help people get up to speed. Around five hundred people have successfully got code into Sage, and you can too if you are serious.

 

{{{id=10| /// }}}

Do a careful slow step-by-step live demo that illustrates steps 1-3 above, based on a request from a student in class.

my_laptop ssh math480@sage.math.washington.edu

math480@sage:~ cd scratch
math480@sage:~/scratch ls
sage-4.6.2-sage.math.washington.edu-x86_64-Linux.tar.gz
math480@sage:~/scratch mkdir wstein
math480@sage:~/scratch cd wstein/
math480@sage:~/scratch/wstein ls
math480@sage:~/scratch/wstein tar xf ../sage-4.6.2-sage.math.washington.edu-x86_64-Linux.tar.gz 
[[Wait about 1 minute.]]
math480@sage:~/scratch/wstein cd sage-4.6.2-sage.math.washington.edu-x86_64-Linux/
math480@sage:~/scratch/wstein/sage-4.6.2-sage.math.washington.edu-x86_64-Linux ls
COPYING.txt  devel     ipython	Makefile    sage		 spkg
data	     examples  local	README.txt  sage-README-osx.txt  VERSION.txt
math480@sage:~/scratch/wstein/sage-4.6.2-sage.math.washington.edu-x86_64-Linux here  # sets up path
math480@sage:~/scratch/wstein/sage-4.6.2-sage.math.washington.edu-x86_64-Linux sage
----------------------------------------------------------------------
| Sage Version 4.6.2, Release Date: 2011-02-25                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
The Sage install tree may have moved
(from /mnt/usb1/scratch/jdemeyer/merger/sage-4.6.2 to /levi/scratch/math480/wstein/sage-4.6.2-sage.math.washington.edu-x86_64-Linux)
Changing various hardcoded paths
(please wait at most a few minutes)...
Do not interrupt this.
Done resetting paths
sage: 

Now make some change (using vim, emacs, pico, etc.), do "sage -br" to make change take effect. Then make a patch and export it.

{{{id=5| /// }}} {{{id=8| /// }}} {{{id=3| /// }}} {{{id=1| /// }}}