Re: [Numpy-discussion] numpy distutils patch

2007-11-20 Thread Jarrod Millman
On Nov 19, 2007 6:09 PM, David M. Cooke <[EMAIL PROTECTED]> wrote: > My opinion is that it's not necessary, or correct. The fix leaves > quotes in if there is no whitespace, so '"Hi"' is converted to > ['"Hi"'], while '"Hi there"' becomes ['Hi there']. I can't see when > you'd want that behaviour.

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread David.Goldsmith
Chris, just to be clear, this is addressed to the OP, correct? DG Christopher Barker wrote: > I'm a bit confused too. > > What would be great is a simple trimmed down example -- a > small-as-you-can-make-it class with a method that shows what you need, > perhaps with a little C++ sample that us

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Christopher Barker
Christopher Barker wrote: > What would be great is a simple trimmed down example -- .. and then we'd have an example to put in the numpy.i docs and examples, too. By the way Bill, I haven't forgotten the examples I said I'd add to the docs. I've been distracted away from my SWIG work lately,

Re: [Numpy-discussion] Building installers using bdist_mpkg on Leopard

2007-11-20 Thread Christopher Barker
this looks like a question for the pythonmac list -- have you tried there? -Chris Chris wrote: > There appears to be a bug in bdist_mpkg on Leopard: it requires > an "admin" group that does not exist by default. The mpkg build > dies with a ValueError saying that the group does not exist. Is it

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Christopher Barker
I'm a bit confused too. What would be great is a simple trimmed down example -- a small-as-you-can-make-it class with a method that shows what you need, perhaps with a little C++ sample that uses it. Then we can see how best to wrap it for python. -Chris -- Christopher Barker, Ph.D. Oceano

Re: [Numpy-discussion] OT: A Way to Approximate and Compress a 3D Surface

2007-11-20 Thread Christopher Barker
Anne Archibald wrote: >In particular it looks like VTK might be able > to do what you want. yes, it can. The way I've seen is to triangulate the surface, then do "decimation" -- remove the triangles that don't add "much" to the detail of the surface. I don't know of a way to do something similar

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Bill Spotz
Here is what I am proposing you do: in your interface file, add something like PyObject * getMatrix() { npy_intp dims[2] = { /* Obtain the dimensions to your internal matrix */ }; double * data = /* Obtain the pointer to you internal matrix */; return PyA

Re: [Numpy-discussion] OT: A Way to Approximate and Compress a 3D Surface

2007-11-20 Thread Anne Archibald
On 20/11/2007, Geoffrey Zhu <[EMAIL PROTECTED]> wrote: > I have N tabulated data points { (x_i, y_i, z_i) } that describes a 3D > surface. The surface is pretty "smooth." However, the number of data > points is too large to be stored and manipulated efficiently. To make > it easier to deal with, I

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > OK, so the key here is the *internal* matrix. I think you need to > provide a way to extract that matrix from the C++ application as a numpy > array. Then you can provide it to your function/method as an INPLACE > array. No new memory will be allocated. [...] > The INPLACE typemaps

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread David.Goldsmith
Bill Spotz wrote: >> Again, see above for my use case. >> But the fortran ordering should not be that hard (only setting the >> flags >> and strides right, as in FARRAY2_OUT in numpy2carray.i) - but of >> course >> someone has to do it ... ;) >> > > Yes, it shouldn't be too hard. And I li

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Bill Spotz
On Nov 20, 2007, at 7:24 AM, Georg Holzmann wrote: > Yes but this means that you again allocate an array of the same size. > E.g. in my algorithm I can have a very big internal matrix in C++ OK, so the key here is the *internal* matrix. I think you need to provide a way to extract that matrix

Re: [Numpy-discussion] OT: A Way to Approximate and Compress a 3D Surface

2007-11-20 Thread Francesc Altet
A Tuesday 20 November 2007, Geoffrey Zhu escrigué: > Hi Everyone, > > This is off topic for this mailing list but I don't know where else > to ask. > > I have N tabulated data points { (x_i, y_i, z_i) } that describes a > 3D surface. The surface is pretty "smooth." However, the number of > data poi

[Numpy-discussion] OT: A Way to Approximate and Compress a 3D Surface

2007-11-20 Thread Geoffrey Zhu
Hi Everyone, This is off topic for this mailing list but I don't know where else to ask. I have N tabulated data points { (x_i, y_i, z_i) } that describes a 3D surface. The surface is pretty "smooth." However, the number of data points is too large to be stored and manipulated efficiently. To mak

Re: [Numpy-discussion] numpy : your experiences?

2007-11-20 Thread Fernando Perez
On Nov 20, 2007 1:48 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > > On Nov 19, 2007 5:19 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: > > We use it for the core of long-running computations: > > > > http://dx.doi.org/10.1016/j.acha.2007.08.001 > > > > Heh, On subgroups of the Monster con

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Matthieu Brucher
> > > Of course : http://matt.eifelle.com/item/5 > > It's a basic version of the wrapper I use in my lab (pay attention to > > the constructor for instance), I hope you will be able to do something > > Thanks ! > But this assumes that the data in my C++ library is stored in a > PyArrayObject ? Y

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > Is there any doc on numpy.i usage? yes there is a pdf in /numpy/doc/swig ! LG Georg ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > Of course : http://matt.eifelle.com/item/5 > It's a basic version of the wrapper I use in my lab (pay attention to > the constructor for instance), I hope you will be able to do something Thanks ! But this assumes that the data in my C++ library is stored in a PyArrayObject ? This is

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Matthieu Brucher
> > > If what you want is to provide a view from your C++ matrix, this is > > different. You must either : > > - propose the array interface > > - use a Python object inside your C++ matrix (this is to be done, I've a > > basic example in my blog) > Of course : http://matt.eifelle.com/item/5 It's

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Neal Becker
Christopher Barker wrote: > > > Georg Holzmann wrote: >> Because I had some troubles in wrapping my C++ library in python/numpy, >> I did (another) numpy2carray.i file for SWIG. > > How is this better/different than numpy.i in: > > numpy/doc/swig/numpy.i > >> With that interface file it is po

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > E.g. in my algorithm I can have a very big internal matrix in C++ (say > 700 MB - in fortran style). Now I want to have this matrix in numpy to > plot some parts of it, get some data out of it ... whatever - if I again > allocate an array of the same size, I am out of memo

Re: [Numpy-discussion] numpy : your experiences?

2007-11-20 Thread Lou Pecora
--- Rahul Garg <[EMAIL PROTECTED]> wrote: > hi. > > thanks for ur responses .. so it looks like > python/numpy is used more > for gluing things together or doing things like > postprocessing. is > anyone using it for core calculations .. as in long > running python > calculations? > i used numpy

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Matthieu Brucher
2007/11/20, Georg Holzmann <[EMAIL PROTECTED]>: > > Hallo! > > > Really? I worked pretty hard to avoid copies when they were not > > necessary. For the ARGOUT typemaps, I allocate an array of the > > requested size and then pass its data buffer to your function. If > > Yes but this means that yo

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > Really? I worked pretty hard to avoid copies when they were not > necessary. For the ARGOUT typemaps, I allocate an array of the > requested size and then pass its data buffer to your function. If Yes but this means that you again allocate an array of the same size. E.g. in my a

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Bill Spotz
On Nov 20, 2007, at 1:12 AM, Georg Holzmann wrote: > The problem I had with numpy.i: > > - it copies the arrays on output (Argout Arrays) which was not > possible > for my algorithms (I have some very big matrices) Really? I worked pretty hard to avoid copies when they were not necessary. F

Re: [Numpy-discussion] numpy : your experiences?

2007-11-20 Thread Vincent Schut
Rahul Garg wrote: > a) Can you guys tell me briefly about the kind of problems you are > tackling with numpy and scipy? mainly timeseries of Remote Sensing data ('satellite images') processing. No really fancy math, but huge (sometimes multiple gigabytes) multidimensional (date, bands, y, x: order

Re: [Numpy-discussion] numpy : your experiences?

2007-11-20 Thread Charles R Harris
On Nov 19, 2007 5:19 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: > On Nov 19, 2007 4:05 PM, Rahul Garg <[EMAIL PROTECTED]> wrote: > > hi. > > > > thanks for ur responses .. so it looks like python/numpy is used more > > for gluing things together or doing things like postprocessing. is > > anyon

Re: [Numpy-discussion] numpy : your experiences?

2007-11-20 Thread lorenzo bolla
> a) Can you guys tell me briefly about the kind of problems you are > > tackling with numpy and scipy? > > > Electromagnetic problems: eigenvalues finding, linear systems, > optimizations... > > b) Have you ever felt that numpy/scipy was slow and had to switch to > > C/C++/Fortran? > > > > I come

Re: [Numpy-discussion] numpy : your experiences?

2007-11-20 Thread Matthieu Brucher
> > a) Can you guys tell me briefly about the kind of problems you are > tackling with numpy and scipy? Manifold learning, and thus unconstrianed optimizations b) Have you ever felt that numpy/scipy was slow and had to switch to > C/C++/Fortran? Not if it is done correctly (I just kept some p

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread David.Goldsmith
Georg Holzmann wrote: >>> (I also included an example for an interface to >>> fortran style arrays). >>> >> That, it doesn't have. >> It has ;) ... look in numpy2carray.i, FARRAY2_OUT (line 175). >> But yes, sorry, I did no example in example.cpp ... >> I'm pretty sure Chris meant that

Re: [Numpy-discussion] numpy : your experiences?

2007-11-20 Thread Charles R Harris
On Nov 19, 2007 4:05 PM, Rahul Garg <[EMAIL PROTECTED]> wrote: > hi. > > thanks for ur responses .. so it looks like python/numpy is used more > for gluing things together or doing things like postprocessing. is > anyone using it for core calculations .. as in long running python > calculations? >

[Numpy-discussion] ndim argsort question

2007-11-20 Thread Vincent Schut
Hi, I'm getting a bit lost in numpy's fancy indexing, using argsort on a slice of a 4d arrays, and then using the resulting indices to sort other slices of that same array, preferably in one go. I have a data[d, b, y, x] array (for the curious: date, band, y, x: satellite image) Then I create a s

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > How is this better/different than numpy.i in: > > numpy/doc/swig/numpy.i The problem I had with numpy.i: - it copies the arrays on output (Argout Arrays) which was not possible for my algorithms (I have some very big matrices) - it is not possible to 2D or 3D Argout Arrays (why?), in