Friday, August 19, 2011

GSoC: final week

Well, I obviously haven't kept up with my blogging. Partly this is because there wasn't too much to report - I've been stuck at the few remaining bugs for a couple of weeks now and just couldn't make myself go at them for real. Still, I've now tentatively submitted a "final" pull request, which has some misc fixes and more importantly adds the "use2to3" script that will form the basis of our Python 3 support. The idea is to run the script, which will create a "sympy-py3k" directory, which is a copy of the SymPy directory structure but with 2to3 ran where required. It should then be possible to use SymPy normally under Python 3 from that folder (even installing it). Now, this script could do with some improvements (looking at "git ls-files" instead of traversing the whole dir structure for one), but most importantly it is not really well tested. I've only tested it on my computer and while it should be sound there have already been some problems reported (in the pull request). Still, the script should hopefully be robust and so, if you have the time and/or care about Python 3 support at all: please try out the script and see if it breaks. You can get it in my "porting4" branch.

Now, there are some issues remaining (Ronan is working on the LambertW issue and the other two, test_priority error and tensor doctest failures are on the issue tracker), but I still consider my project as successful. Python 3 support is a moving target anyway (all new code that gets in is another potential error, at least until people start actively testing it) and I also expect issues to crop up that just aren't covered by the test suite. For the moment, Python 3 support can be considered an experimental, dev feature and I'd like to keep it that way for a few weeks before considering a release. Again, if you are interested in Python 3 support, please try it out, start using it for your normal work and note if something unexpected comes up.

For the foreseeable future, I definitely intend to stay with SymPy. I found the hacking genuinely interesting and would like to finish my stated goals of achieving both Python 3 and PyPy compatibility. Part of my reasoning is completely selfish - I expect these skills to be quite valuable in the near future and hacking one a code base as large as SymPy is bound to teach me a few tricks. Mostly, though, I'd just like to make SymPy better - my line of thought being, if I can do the mundane infrastructure work, then that will enable the mathematicians and physicists among us to implement more cool algorithms.

I'd also like to extend my thanks to Ronan Lamy, my mentor, who was kind enough to solve a few issues for me and for generally always being around to point me in the right direction; to Aaron Meurer, the maintainer of SymPy, who always had the time for a detailed review of my code, even if our views didn't always coincide :) (mpmath, anyone?); and finally, to all the other devs in SymPy who've helped me by reviewing my code and for making such a great program in the first place!