[SciPy-user] Performance Python with Weave article updated

Michael Sorich mike_lists at yahoo.com.au
Thu Sep 23 10:39:46 CDT 2004

My 2 cents worth.

I am a biologist who learnt python to facilitate my
research. I have found it so useful that I have not
been able to justify the time to learn more than a
smattering of C/C++. I find that NumPy is great for
most cases where plain python would be too slow, but
it is not suitable for all situations.  Writing the
occasional small extension using numeric arrays is a
real pain and doesn't seem to fit with the simplicity
of python in general.

One of the big reasons that I like weave is the
simplicity of the blitz arrays. The inline code
usually looks very similar to the python code I
prototype. This allows people like me (with very
limited experience in C/C++ or fortran) to quickly and
simply speed up nested loops involving manipulation of
arrays. My thanks to those who wrote Weave.

I think pyrex is a wonderful concept. However, most of
the code I want to speed up involves
lookup/manipulation of arrays (in ways that NumPy is
not suited to), which is still complicated in pyrex. I
think it would be great if one could index numeric
arrays in pyrex (or with any extension method) in the
same manner as one does in python.


 --- Fernando Perez <Fernando.Perez at colorado.edu>
> Prabhu Ramachandran wrote:
> > What I am really interested in, is to see if there
> is a way to
> > manipulate the arrays in a more elegant fashion. 
> All this pointer
> > arithmetic is fine, but ultimately you'd like
> something that is easy
> > to write.  I can't find anything simpler than the
> slower inline code.
> > I'm sure, that with some effort one can build an
> extension class
> > around the numeric array inside Pyrex to expose
> the array as a nice 2D
> > Numeric-ish array so the array computations can be
> more elegant.
> > 
> > It might then be a good idea to abstract that
> interface into a simple
> > Pyrex library that folks can use to write simple,
> elegant code to
> > write their high-performance routines with.
> +1000 :)
> This would be _really_ useful: a simple interface
> for common indexing of 
> arrays with 1-4 indices (the realistic usage cases
> in most scientific 
> computing).  The boilerplate gets written _once_,
> and from then on we all 
> benefit.  I can't do it myself, but I'll cheer all
> you want :)
> Best,
> f
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user

Find local movie times and trailers on Yahoo! Movies.

More information about the SciPy-user mailing list