(A Creative Blog Name Here)

Code, math, and other things I find useful

IPython parallel

When I start IPython the first two commands I run are

%load_ext autoreload
%autoreload 2

which forces IPython to reload code before running it so that the newest version is always used. However, when developing code to run in parallel with the IPython.parallel module on a cluster started with ipcluster the code will invariably break. The engines will continue using the old version until they are explicitly reloaded using %px reload(broken_module).
Alternatively, we could use the autoreload extension

%px %load_ext autoreload
%px %autoreload 2

This will cause the engines to reload code before it tries to execute it. All of this assumes that the engines are using the same filesystem as the user's IPython session.

ipython