sampledoc's Scientific Python Tools

Table Of Contents

Previous topic

A Dialog on Python for Scientific Computing

Next topic

First introduction to Python

This Page

Introduction

The aim of these pages is to provide enough information in order to help students to start using python’s tools for computational science, numerical methods and implementation of numerical algorithms.

Python is not a Matlab clone, but a very flexible and very powerful (be aware!) high-level programming language. Still, it is so simple to use, that we’ll learn it by doing our own job... We focus on scientific computing now, but you might use it for very different tasks, from controlling your experimental machines, by making high-performance visualizations, to sorting your mp3’s on your mobile phone.

While coming with ‘batteries included’ python is only a small kernel that should be completed by modules specialized for your aims.

We’ll use the following python modules:

For the numerics lecture (“Numerische Methoden D-PHYS”) we will use the very same Virtual Box machine which was used during the computer science (“Informatik”) course. All python related tools we will need during this lecture are already installed there and ready for use. (Note that some of the tools shown in the advanced chapter might be missing.) For details on the installation and usage of this virtual machine, we refer to: Anleitung zur Installation von VirtualBox. This machine was kindly prepared by people taking care of the computer science lecture. For the rest of this tutorial we will assume you have a working installation.

Work flow

The two recommended ways of using ipython are:

  • Your favorite text editor and the ipython interpreter running in a shell (terminal). This is also the only supported work flow possible during the computer exam. The tutorial assumes this working style.
  • The ipython-notebook. It’s main advantage is that it unifies Code, Output, inline graphics and text/formulas. Similar to Mathematica. Furthermore it provides inline documentation, i.e. function signatures and help, directly under the cursor.

Warning

Please be aware that the only supported setup on the exam computers consists of an editor (gedit) and the ipython interpreter running in a shell. Hence you should be familiar with that too. Other tools might or might not be installed and their use is at your own risk.

The ipython-notebook

Inside the Virtual-Box installation you can run the notebook with:

python -m IPython notebook --no-mathjax --matplotlib=inline --notebook-dir=/home/ifmp14/
_images/ipython_notebook.png