[Numpy-discussion] pyrex numarray

Francesc Altet faltet at carabos.com
Thu Feb 3 09:10:15 CST 2005


A Dimarts 01 Febrer 2005 02:16, Simon Burton va escriure:
> Has anyone considered using pyrex to implement numarray ?

None that I'm aware of. But this issue has been already discussed in
this list at least a couple of times before. See, for example:

http://sourceforge.net/mailarchive/message.php?msg_id=8080203

> I don't know a lot of the details but it seems to me that pyrex could
> unify numarray's python/c source code mixture and smooth the transition
> from python (==untyped pyrex) code to c (==typed pyrex) code. It would also
> help clueless users like me understand, and perhaps contribute to, the
> codebase.

Well, after the past discussions, I've got the feeling that the main
problems to do that are:

1.- Construct general Ufuncs that can handle many different
  combinations of arrays and types. I think that this is currently
  done through a use of some C preprocesor than creates specific C
  files from kind of template (correct me if I'm wrong there). Do the
  same thing with Pyrex may potentially need such a preprocessor as
  well.
  
2.- Recoding the numarray beast in Pyrex could be *major* task

3.- The lack of experience with Pyrex (at least some time ago)

Perhaps I miss something still more important, but my guess is that
these reasons are the real stoppers. While problem 3 can be quite
easily surmounted, problem 1 probably is the big one (except if one
finds some easy way to deal with it). Although now that I think, one
can always take advantage of the files coming from the current
numarray C preprocessor and use Pyrex as the glue with Python. Problem
2 is also worrying but a combined effort could contribute to alleviate
it.

However, I do think that is probably worth the effort to concentrate
the efforts resolving first the remaining problems with numarray
performance (mainly array creation time), than go and switch to yet
another implementation that would take far more time to implement.

My 2 cents,

-- 
>qo<   Francesc Altet     http://www.carabos.com/
V  V   Cárabos Coop. V.   Enjoy Data
 ""





More information about the Numpy-discussion mailing list