[Numpy-discussion] mixing NUMERIC and NUMARRAY

Todd Miller jmiller at stsci.edu
Mon May 12 13:52:02 CDT 2003

On Mon, 2003-05-12 at 16:06, Gerard Vermeulen wrote:
> Hi,
> It was remarkable easy to make my plot package PyQwt for Numeric, also
> compatible with numarray :-)

Great!  That's they way things are *supposed* to work, and usually do,
but don't always.

> ( PyQwt is a wrapper for Qwt, a Qt-based library with widgets useful for
>   science and engineering -- http://gerard.vermeulen.free.fr ) 
> I discovered by accident that PyQwt compiled with
> #include <numarray/arrayobject.h>
> plots Numeric-arrays and that PyQwt compiled with
> #include <Numeric/arrayobject.h>
> plots numarray-arrays.

This part sounds a little backward.  Presumably this was a typo.

> The only interface between PyQwt and Numeric (or numarray) passes through
> PyArray_ContiguousFromObject to cast sequences into arrays from which data
> is copied into Qwt's data structures.
> PyQwt never returns Numeric- or numarray-arrays.
> Is this feature platform dependent? 

Yes, if I understand your question correctly.

> Or is it safe to release PyQwt,
> claiming that a Numeric-compiled PyQwt is compatible with numarray
> and vice-versa?

No dice.  numarray is currently trying for source level compatibility
only, so an extension compiled for Numeric creates slightly different
object code than one compiled for numarray;  slightly different means
inoperable.  Still, it's good to know that PyQwt is very close to
workable for numarray.
> Gerard

> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Todd Miller 			jmiller at stsci.edu

More information about the Numpy-discussion mailing list