Scientific Libraries in Python

Chris Barker chrishbarker at home.net
Thu Nov 15 19:24:15 EST 2001


Nice Summary of the state of the art:

A few comments:

Fernando Pérez wrote:

> Libraries:
> 
> SciPy at http://scipy.org
> Comment: This seems to be by consensus the horse to bet on as a base
> platform. It seems to have a great architecture and very good ideas (the
> compiler is *really* cool). But its coverage is still very patchy.

I am one of the folks that think this is the horse to bet on. Mostly
because the project has been set up from the beginning to be a framework
for a comprehensive library.


> GSL -- The GNU Scientific Library at http://sources.redhat.com/gsl
> There may be licensing issues that need to be addressed.

It is GPL'd, which is a pity, it seems a prime candidate for the LGPL.
Anyway, it would seem to me that linking it with Python would be license
issue, although Python's current license is supposed to be "GPL
Compatible". Does anyone know what that means? Can this be clarified by
someone who knows what they are talking about? I'd love to know whether
this is a project I should delve into.


> Visualization:

I agree that Visulisation is key. You didn't mention it here, but the
problem I have with most of the available stuff is that it is all
wrappers around other external packages. To really get what I want, I
need to be able to access the primitives form Python. That means a lot
of the code should probalby be in Python, or at least written with this
kind if access in mind.

I've been imagining a package built in Python that looks a lot like
MATLAB's handle graphics (although with OO, you wouldn't need the
handles). MATLAB's system makes it very easy to whip out a plot:

plot(x,y)

but you can also get access to all the properties of the plot, so that
you can customise things as much as you like. I think all plots are
created by a set of only three types of primitives, a line, a patch
(surface), and a text object. It really works pretty well. I also
believe that all plots are 3-d with 2-d plots being a special casse,
where z=0 everywhere, and the view is from the top.

The system is set up eith a hierarchy something like this:

Figure:
   Any number of Axis:
      Properties of the Axis (limits, location, view position, etc.)
      Any number of lines 
         Properties of the line (Markers, color, width, data(x,y,z),
etc)
      Any number of patches
         Properties of the patch (Color, data(x,y,z), etc)
      Any number of text objects
         Properties of the text (color, font, size, etc)

  

Anyway, it's a pretty nifty system, and I think one like ot for Python
would be great. The Graphite project (http://Graphite.sourceforge.net/)
was a nice start to this, and I think the native SciPy one looks pretty
promising as well.

My main feeling is that we really do need something native to Python. A
wrapper around an external package will never be flexible enough to
really compete withe MATLAB or IDL.

> MayaVi at http://mayavi.sourceforge.net
> -----

> Comment: this seems the most promising tool to me from what I've seen, though
> it's pretty 'heavyweight'. If a good interface can be made for interactive
> prompt use and python scripted control, I think it's a winner. I don't know
> how it handles 2d plots (if at all). But I tend to think it's easier to add
> 2d functionality to something like this rather than growing a 2d or basic 3d
> tool into a full blown visualizer that handles volume rendering.

I agree.  framework like what I suggest above, built on top of MayaVi,
or directly on VTK, or even more directly on OpenGL, would be great!!

> Final comment: that's what I see as the key players at this point.
> In my ideal fantasy world, a single 'import ScientificTools' (whatever you
> want to call it) would give me python access to all the above functionality,
> with a sane overall naming structure.

Another think I'd love to see is a "Scientific Python Distribution" this
would be all of Scientific Python all packaged up with Python itself,
all compiled and ready to go (with optimised BLAS, etc) for your
platform of choice.

It would also support MacOS, along with *nix and MSW.

-Chris


-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list