Re: void * C array to a Numpy array using Swig

2006-01-13 Thread Travis E. Oliphant
Krish wrote: > Hello People > > I hope I am On Topic. Anyways, here is my problem. Any insights would > be really appreciated. Posting to the [EMAIL PROTECTED] list would help generate more responses, I think. > > I have wrapped a C IO module using SWIG -> Python Module. Suppose the > name of

Re: void * C array to a Numpy array using Swig

2006-01-13 Thread Krish
Thanks Jon Much I will implement your method for the time being. I am sure there is some method which doesn't copy the data but uses the existing data. I mean essentially we should build a PyArrayObject with the data intact and other parameters filled. If someone sheds some light, would be awesom

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Travis E. Oliphant
Philip Austin wrote: > "Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > > >>Krish wrote: > > >>Yes, you are right that you need to use typemaps. It's been awhile >>since I did this kind of thing, but here are some pointers. > > > Also, there's http://geosci.uchicago.edu/csc/numptr > This

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Philip Austin
"Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > Krish wrote: > Yes, you are right that you need to use typemaps. It's been awhile > since I did this kind of thing, but here are some pointers. Also, there's http://geosci.uchicago.edu/csc/numptr -- http://mail.python.org/mailman/listinfo/p

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Jon
Krish, In case you find a good solution, I am also looking for one! For now I essentially use helper functions on the c side which wrap in SWIG to return the data as a string in python. That string can then be converted to a numpy array using the fromstring function. This is inefficient as it doe

void * C array to a Numpy array using Swig

2006-01-11 Thread Krish
Hello People I hope I am On Topic. Anyways, here is my problem. Any insights would be really appreciated. I have wrapped a C IO module using SWIG -> Python Module. Suppose the name of the module is "imageio" and the reader function from the file is image_read() which returns an object ( "filled"