A hands-on 2-day workshop at UC Berkeley¶
We will be holding an introductory workshop covering the use of the Python programming language for scientific computing on campus, on October 9 and October 16, 2008.
The workshop is targeted at the level of a graduate student in engineering or the sciences. A working knowledge of basic programming is assumed, as well as familiarity with calculus, basic linear algebra, FFTs, and other similar topics.
We will briefly review the core language and will cover a number of basic exercises involving numerics, using the core libraries for scientific manipulation in Python (Numpy and Scipy), plotting with Matploblib, analyzing data files, etc. The workshop is very interactive, consisting mostly of hands-on exercises to be completed by the students, interleaved with ‘type-along’ sessions where we’ll demonstrate ideas by typing them out while you follow along on your own computer.
The course will not go into advanced aspects of Python; we will review the basics, but will assume that you have worked through the introductory resources available online (see below).
The workshop will take place October 9 and 16 2008, 9am-5pm at Tolman 5101. We only have room for about 20 people total, so email me if you are interested in attending so we can reserve a slot for you (first come, first served). Please include your full name, department, affiliation (student, postdoc, faculty, staff...) as well as a short note on your programming background and research interest regarding the workshop, so we can know the audience a bit better.
There is a $10 charge for each person to cover the cost of having coffee, bagels and snacks available in the room, so we can take coffee breaks without everyone having to leave the building. Lunch both days will be on your own.
We’ll have work tables and power strips available, but no computers. The point of the workshop is for you to work on your laptop, so that after this you have all the tools locally installed to continue working. You must also ensure that you can connect to the AirBears network, so you can have access to various files and data online.
Before the workshop, we strongly encourage you to install the necessary tools on your laptop. We’ll do an install check on the first day in the morning, but it will be much better if you do the installation in advance.
For Mac OSX and Windows users, the easiest (by far) route is to install the Enthought Python Distribution, which provides a self-contained installer with all the tools we’ll need.
Linux users need to get the following packages, either by using their distribution’s package manager or by installing from source: nose, setuptools, ipython, numpy, scipy, matplotlib.
Once you’ve installed the code above, please download (save to your disk) this file and execute it as per the instructions contained in it (at the top). It runs a set of sanity checks on your system to ensure that things are reasonably well installed (it does not do exhaustive testing however).
Documentation and reading prerequistes¶
Note: in all of these, the markers that you see as
>>> are the prompts
generated by Python which you do not type. Similarly, the IPython prompts
In addition to these two minimal requirements, the following links can also be useful as reference:
- Interactive data analysis: a tutorial with an astronomy focus but very useful for anyone dealing with data. This is an excellent resource.
- The NumPy reference guide: though still a draft, it contains much useful information.
- The Matplotlib manual: this is the matlab-like plotting library we’ll be using throughout.
- The IPython manual: the interactive environment you’ll be working in.
- The SciPy documentation page contains links to many more documentation resources, especially for scientific work.
Finally, fhe following Python books are freely available to UC Berkeley via the O’Reilly Safari system. These are books I have personally found to be useful and can recommend, there’s obviously a lot more out there; all of them cover the language in general, without science-specific content.
- Learning Python, 3rd Edition by Mark Lutz.
- Python Pocket Reference, 2nd Edition by Mark Lutz.
- Python in a Nutshell, 2nd Edition by Alex Martelli.
- Python Cookbook, 2nd Edition by Alex Martelli; Anna Martelli Ravenscroft; David Ascher.
Note that to access Safari, you need to be either on campus or browsing with the Berkeley Library Proxy.
To register or if you have any personal question regarding the workshop, you can email me. But for general questions, installation issues, etc, I encourage you to use the Py4science mailing list, so that the answer to your question can benefit others as well who may encounter similar problems. You are also welcome to stop by any of the regular Py4Science meetings on campus.