Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Scott David Daniels
Bo Peng wrote: Scott David Daniels wrote: I wrote "blocks and views" to overcome this problem. I was too impatient to wait for your reply. :-) I call 21-hour turnaround over New Year's Eve pretty good. Clearly I will never be quick enough for you ;-). Since I presented this at the Vancouver Pytho

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Bo Peng
Scott David Daniels wrote: Python's array module is not built to do this well. It can re-size the array, delete elements inside the array, and other things that don't work very well with C-managed data. I wrote "blocks and views" to overcome this problem. As always the case, this problem have b

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Scott David Daniels
Bo Peng wrote: Dear list, I am writing a Python extension module that needs a way to expose pieces of a big C array to python. Currently, I [use] NumPy Users ... actually > change the underlying C array. Python's array module is built-in, easy to use, but *without* a FromLenAndData function!

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Raymond L. Buvel
Bo Peng wrote: Dear list, I am writing a Python extension module that needs a way to expose pieces of a big C array to python. Currently, I am using NumPy like the following: PyObject* res = PyArray_FromDimsAndData(1, int*dim, PyArray_DOUBLE, char*buf); Users will get a Numeric Array object an

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Craig Ringer
On Sat, 2005-01-01 at 10:27 -0600, Bo Peng wrote: > Sorry if I was not clear enough. I was talking about the differece > between python array module > (http://docs.python.org/lib/module-array.html, Modules/arraymodule.c in > the source tree) and NumPy array. They both use C-style memory block

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Bo Peng
Craig Ringer wrote: On Sat, 2005-01-01 at 08:18, Bo Peng wrote: Python's array module is built-in, easy to use, but *without* a FromLenAndData function! Even the buffer interface provides only 'get buffer' but no 'set buffer' functions. Could anyone tell me how I can create an array object from

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Craig Ringer
On Sat, 2005-01-01 at 08:18, Bo Peng wrote: > Python's array module is built-in, easy to use, but *without* a > FromLenAndData function! Even the buffer interface provides only 'get > buffer' but no 'set buffer' functions. Could anyone tell me how I can > create an array object from existing da

exposing C array to python namespace: NumPy and array module.

2004-12-31 Thread Bo Peng
Dear list, I am writing a Python extension module that needs a way to expose pieces of a big C array to python. Currently, I am using NumPy like the following: PyObject* res = PyArray_FromDimsAndData(1, int*dim, PyArray_DOUBLE, char*buf); Users will get a Numeric Array object and can change it