ScientificPython User's Guide

ScientificPython User's Guide

Konrad Hinsen
Centre de Biophysique Moléculaire (CNRS)
Rue Charles Sadron
45071Orléans Cedex 2
France
E-Mail: hinsen@cnrs-orleans.fr

Introduction

ScientificPython is a collection of Python modules that are useful for scientific computing. Most modules are rather general, others belong to specific domains and will be of interest to only a small number of users (e.g. the module Scientific.IO.PDB). Almost all modules make extensive use of Numerical Python (NumPy), which must be installed prior to Scientific Python. Python 1.5 or later is also required. For more information about Numerical Python and about other packages for scientific computing, see the Topic Guide "Scientific Computing" on the Python home page.

This manual describes version 2.0 of ScientificPython. This is a completely revised release and not compatible with earlier releases. The major difference is the introduction of a package structure; all modules are now submodules of the top-level module Scientific. The package structure should prevent name clashes with other modules, which have occurred in the past (e.g. the module PDB was indistinguishable from the module pdb in the Python standard library on operating systems without case distinction in filenames).

For most code written for versions 1.x of ScientificPython, a change of the import statements should be all that is required to make it compatible with this release. The only module with significantly changed functionality is Scientific.Statistics.Histogram; the changes were necessary to implement an algorithm that is much more efficient for large data sets. There are of course also additional modules and enhancements to existing ones, but they don't affect compatibility. The most significant addition is the module Scientific.IO.NetCDF, which was previously distributed separately.

It should be noted that ScientificPython 2.0 can coexist with an older version, as all module names are different. However, the availability of both versions in parallel makes it difficult to verify that code has been ported to use the new one.

Installation on Unix systems

The first step in installation is compilation of the C modules. There is currently only one C module, the netCDF interface module. If you do not need the netCDF module, you can skip the compilation step. If you do want to compile it, you must first install the netCDF library, version 3 or higher. Then copy the file Src/Setup.in to Src/Setup and edit the copy to reflect the installation of the netCDF library on your system. If the library archive is in /usr/local/lib and the header files in /usr/local/include, nothing has to be changed. Once the file Src/Setup is ready, type "./compile" in the top directory of the distribution.

The second step is the installation of ScientificPython in a publicly accessible place. This is done by typing "./install" in the top directory of the distribution. This copies the directory Scientific to the directory site-packages in the standard Python library. Depending on the location of this directory, installation of ScientificPython may require root privileges. However, ScientificPython can also be installed manually by copying the directory Scientific with all its contents into a directory on the Python search path.

Reference for Module Scientific

Module Scientific.DictWithDefault
Module Scientific.Functions
Module Scientific.Geometry
Module Scientific.IO
Module Scientific.NumberDict
Module Scientific.Physics
Module Scientific.Statistics
Module Scientific.TkWidgets
Module Scientific.Visualization
Module Scientific.indexing