[Numpy-discussion] numpy 1.0

Travis Oliphant oliphant.travis at ieee.org
Mon Jul 24 13:05:35 EDT 2006


Graham Cummins wrote:
> Greetings,
>
> I just downloaded numpy 1.0b1. I see a lot of changes from 0.9.8, and 
> I'm curious as to whether these changes will be a lasting property of 
> numpy 1.0 and later.
>
> Most of the changes relate to nomenclature for type constants (e.g. 
> int32, complex128, newaxis) and functions (e.g. inverse_real_fft -> 
> ifft). Although it takes some time to comb through code for all of the 
> possible name changes (there are lots!), it's easy enough to do.
Release notes will be forthcoming.  These changes will be lasting...

What changed is that "old" names were placed only in a compatibility 
module (numpy.oldnumeric).   Import from there if you want the old names 
(convertcode was also changed to alter Numeric-->numpy.oldnumeric. 

This was done so as to make it clearer what is "old" and for 
compatibility purposes only and what new code should be written with.

>
> The thing that is taking me longer is (as usual) converting c 
> extensions. Float32, and PyArray_Float32 used to be defined in 0.9.8, 
> and are now not. AFAICT, npy_float works in the same way Float32 used 
> to work, but I haven't yet figured out what to use in place of 
> PyArray_Float32 in, for example "PyArray_FROM_OTF(data, ?? , ALIGNED | 
> CONTIGUOUS);"
>
Here, we assigned the prefixes NPY_ and npy_ to all the old CAPITALIZED 
and uncapitalized names, respectively to avoid the problem of name 
clashes which occurs commonly when using NumPy to wrap another library. 

The un-prefixed names are still available when you use

#include "numpy/noprefix.h"    (which is what NumPy itself uses).

>
> On another topic, when I install numpy (version 0.9.8 or 1.0b1) using 
> "seutup.py install", the headers needed to build extensions don't get 
> moved into my python distribution directory tree. I've been moving 
> these files by hand, and that seems to work, but could I pass some 
> argument to distutils that would do this automatically?

To support multiple-version installations of NumPy (like eggs allow) 
it's important to put the headers in their own location and not in a 
system-wide directory.   If you want to place them system-wide, you 
currently need to copy them by hand.  But, it's not recommended to do that.

Just append the output of numpy.get_include()  to the list of include 
directories.



-Travis





More information about the NumPy-Discussion mailing list