Sunday, September 27th, 2009

Updating NumPy, SciPy, and Matplotlib

I recently upgraded to NumPy to 1.4.0.dev7419, SciPy to 0.8.0.dev5953, and matplotlib version 0.99.1.1.

svn co http://svn.scipy.org/svn/numpy/trunk numpy
cd numpy
python setup.py build
python setup.py install
cd ..

svn co http://svn.scipy.org/svn/scipy/trunk scipy
cd scipy
python setup.py build
python setup.py install
cd ..

python
>>> import numpy
>>> numpy.__version__    # '1.4.0.dev7419'
>>> numpy.test('1','10') # 26 errors in 2231 tests, but usable
>>> import scipy
>>> scipy.__version__    # '0.8.0.dev5953'
>>> scipy.test('1','10') # 165 errors in 4515 tests, but usable

rm -rf /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib*
wget http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/matplotlib-0.99.1.1.tar.gz/download
open matplotlib-0.99.1.1.tar.gz
cd matplotlib-0.99.1.1
python setup.py build
python setup.py install
cd ..

ipython -pylab
>>> plot([1,2,3])

/developer   〆   permalink

Monday, July 13th, 2009

Python Link Roundup

Intra-package References

I just found out that Python 2.5 or newer allows relative imports, something I had been writing custom code to work around. Python documentation gives examples in 3 forms:

from . import echo
from .. import formats
from ..filters import equalizer

Packaging Tools

Alex Clemesha explains modern python hacker tools virtualenv, Fabric, and pip. I find all three of them intersting.

pip is an alternative to easy_install where you can install and upgrade python packages easily with commands like:

pip install -U ipython

Fabric facilitates deploying code to a remote location.

virtualenv lets you setup and manage working environments that aren’t littered with everything you ever installed into your global site-packages directory.

I also recommend virtualenvwrapper, which puts a nice interface on top of virtualenv.

/developer   〆   permalink

Sunday, February 1st, 2009

My Hat Size

Future me, your head is 22 5/8 inches around, making you a hat size 7 1/4. You will thank present me for that information one day.

/life   〆   permalink

Saturday, January 31st, 2009

Agreed. Git is Awesome.

I agree with every word in Fine. Git is Awesome.

/developer   〆   permalink

Saturday, January 17th, 2009

Mercurial and Git Links

Useful Mercurial Setup suggestions from Ted Naleid.

Daily Git tips at git ready.

/developer   〆   permalink

Saturday, January 3rd, 2009

Introducing numpyIO.py

I implemented numpyIO.py because I often use scipy.io.numpyio.fread() and scipy.io.numpyio.fwrite(), but I don’t want to depend on scipy. It uses numpy’s tofile/fromfile functions instead.

Why might you want this instead of SciPy’s numpyio? Well, I can think of a few reasons:

  • it imports faster because it only depends on numpy, not scipy
  • easier to package with py2exe or py2app
  • it is slightly faster
  • it lets you avoid rewriting legacy code that makes extensive use of scipy’s deprecated fread/fwrite

Grab the numpyIO project from bitbucket or clone the repo with:

hg clone http://bitbucket.org/lannybroo/numpyio

/developer   〆   permalink