Friday, November 16, 2007

SAGE Days 6 wrap-up

SD6 is over, here are my final notes about the conference:

http://ondrejcertik.blogspot.com/2007/11/sage-days-6.html

SAGE is an exciting project. On SD6 I managed with the help of other SAGE developers to make SymPy play more nicely (after my patches are accepted, you will be able to freely mix SymPy and SAGE expressions and it will work).

Saturday, November 10, 2007

SAGE Days 6

I am at SAGE Days 6, you can watch the progress on my blog.

Monday, November 5, 2007

Unicode printing

One very cool feature of SymPy, that Kirill recently committed, is a unicode printing. Start isympy and see for yourself:

$ bin/isympy
Python 2.4.4 console for SymPy 0.5.6-hg. These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z = symbols('xyz')
>>> k, m, n = symbols('kmn', integer=True)
>>> Basic.set_repr_level(2) # 2D output
>>> pprint_try_use_unicode() # try to setup unicode pprint


In [1]: sqrt((sqrt(x+1))+1)
Out[1]:
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
╱ ⎽⎽⎽⎽⎽⎽⎽
╲╱ 1 + ╲╱ 1 + x

In [2]: th, ph = Symbol("theta"), Symbol("phi")

In [3]: Integral(sin(th)/cos(ph), (th,0,pi), (ph, 0, 2*pi))
Out[3]:
2*π π
⌠ ⌠
⎮ ⎮ sin(θ)
⎮ ⎮ ────── dθ dφ
⎮ ⎮ cos(φ)
⌡ ⌡
0 0


More examples can be found on the wiki page PrettyPrinting.

Fredrik also played with the idea of ascii plotting. I am a huge fan of a terminal, because this is very versatile - I can use it over ssh, I can copy & paste, save the results to a file etc. I can easily script it. And the most important - I just prefer to write my programs in vim and execute them as a simple script. Any GUI, even the best one (or in the browser), is not giving me such a power. So I like the idea of making the terminal experience as pleasant as possible.