Sunday, May 27, 2012

Code repository

To host the code created during the Lattices project, my mentor Daniel Krenn and I decided to set up a code repository at github. While this is not the "native" way of sharing Sage code (which would be Mercurial patches), it has the following advantages:
  • Collaboration is much easier on a shared repository, compared to working with patch files.
  • It is easy to compare and restore previous versions of files.
  • The whole history is also saved locally (in contrast to SVN, for instance) and commits can be made while being offline, which is nice when being on the road. Might always happen in summer.
  • Code can be viewed by others instantly, and even arbitrary people can make suggestions for changes using github pull requests.
  • It is good (i.e., necessary) to have a backup even in the case my private backup system should fail.
The repository is set up like this: I started a new Sage code branch using
sage -clone lattices
thereby creating a new source tree in sage/devel/sage-lattices. The root directory of the repository is the root sage directory, although I only added the files I actually changed (plus the copyright notice) to the repository. Otherwise, the Python code alone make up some 200 MB, which would probably too much for github—at least not very nice (and necessary).

To work with the code, all you have to do is create the lattices branch yourself and check out the github repository to your sage root directory. The few existing files I had to change (setup.py and sage/all.py) should be overwritten during checkout, and the new lattice files will be added.

I will add Daniel as a collaborator on github should he ever want to make small changes himself. Others are welcome, too, to contribute code, of course. Eventually, we will submit a regular Mercurial patch to Sage to be reviewed by the community, or maybe even several "on the go", should that make sense.

So far, there's not much code there yet. I just started working on the basic class hierarchy and the Lattice factory function. More to come soon.

Let me know if you have any suggestions.

2 comments: