Re: [Numpy-discussion] 32/64-bit machines, integer arrays and python ints

2006-09-28 Thread Travis Oliphant
Bill Spotz wrote: >On Sep 28, 2006, at 12:03 PM, Travis Oliphant wrote: > > > >>The other option is to improve your converter in setElements so >>that it >>can understand any of the array scalar integers and not just the >>default >>Python integer. >> >> > >I think this may be the best a

Re: [Numpy-discussion] 32/64-bit machines, integer arrays and python ints

2006-09-28 Thread Bill Spotz
On Sep 28, 2006, at 12:03 PM, Travis Oliphant wrote: > The other option is to improve your converter in setElements so > that it > can understand any of the array scalar integers and not just the > default > Python integer. I think this may be the best approach. This may be something worthwh

Re: [Numpy-discussion] 32/64-bit machines, integer arrays and python ints

2006-09-28 Thread Travis Oliphant
Bill Spotz wrote: > I am wrapping code using swig and extending it to use numpy. > > One class method I wrap (let's call it myElements()) returns an array > of ints, and I convert it to a numpy array with > > PyArray_SimpleNew(1,n,'i'); > You should probably use NPY_INT instead of 'i' fo

[Numpy-discussion] 32/64-bit machines, integer arrays and python ints

2006-09-28 Thread Bill Spotz
I am wrapping code using swig and extending it to use numpy. One class method I wrap (let's call it myElements()) returns an array of ints, and I convert it to a numpy array with PyArray_SimpleNew(1,n,'i'); I obtain the data pointer, fill in the values and return it as the method return