[Numpy-discussion] Supporting both NumPy and Numeric versions of a module

Andrew Straw strawman at astraw.com
Thu Jun 15 22:22:05 EDT 2006

Dear Mary, I suggest using numpy and at the boundaries use
numpy.asarray(yourinput), which will be a quick way to view the data as
a numpy array, regardless of its original type. Otherwise, you could
look at the matplotlib distribution to see how it's done to really
support multiple array packages simultaneously.

Mary Haley wrote:
> Hi all,
> We are getting ready to release some Python software that supports
> both NumPy and Numeric.
> As we have it now, if somebody wanted to use our software with NumPY,
> they would have to download the binary distribution that was built
> with NumPy and install that. Otherwise, they have to download the
> binary distribution that was built with Numeric and install that.
> We are using Python's distutils, and I'm trying to figure out if
> there's a way in which I can have both distributions installed to one
> package directory, and then the __init__.py file would try to figure
> out which one to import on behalf of the user (i.e. it would try to
> figure out if the user had already imported NumPy, and if so, import
> the NumPy version of the module; otherwise, it will import the Numeric
> version of the module).
> This is turning out to be a bigger pain than I expected, so I'm
> turning to this group to see if anybody has a better idea, or should I
> just give up and release these two distributions separately?
> Thanks,
> --Mary
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list