Code Review Session Notes
    UCSC Graduate Student Wiki






  • 01-25-07 iPython (by Greg Novak): What kinds of things are possible?
    => The Advantages of using iPython (over IDL, C, Fortran, etc.) are...
  • less scripting, more flexibility
  • can index by name, unlike IDL which uses number
  • you can treat functions as data objects. functions can take functions as arguments and do stuff to them
  • you can define functions in the line. You don't have to write a separate function elsewhere
  • enormous amounts of (non-astronomy) routines have been written by people. Python can be used to call other codes
  • can use it directly with tex to make pictures
  • PyX can make cool axes, such as curved axes or axes with breaks in it

  • => Using iPython
  • from emacs, call "py-shell"
  • you can then call stuff from the python shell
  • emacs also has this functionality where you can type only a few letters and it will recall what you typed before (can also use dabbrev-expand)
  • can use "tags" to find definition of functions
  • Ediff: can use to look at current vs. previous code. It shows you all the things that have changed
  • pdb: debugger that shows you where an error occured. Can also use the "up" to trace your way back up in the code (i.e. if you found an error and wanted to look at previous lines). "step" is another available command. These, and other shortcut keys can be edited in the .emacs file.
  • run util: like IDL's .r, it reloads the program

  • => Setup of iPython (easy)
  • Install iPython
  • Tell emacs to look for iPython