Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread David Cournapeau
Ray Schumacher wrote: > At 05:22 AM 10/9/2007, David Cournapeau wrote: > >> Could not this be because you compiled the posh sources with a >> compiler/runtime which is different than the other extensions and python >> interpreter ? >> > > It definitely was - since my 2.4 wanted the free 7.1

Re: [Numpy-discussion] numpy/Windows shared arrays between processes? CODE...

2007-10-09 Thread Ray S
# numpyShared.py import numpy as N def arrSharedMemory(shape, dtype, tag="PySharedMemory", access=None): """ Windows only ! share memory between different processes if same `tag` is used. """ itemsize = N.dtype(dtype).itemsize count = N.product(shape) size = cou

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread Robert Kern
Ray S wrote: > Yes, a different methodology attempt. It would be interesting to know > anyway how to create a numpy array from an address; it's probably > buried in the undocumented C-API that I don't grok, and likely > frowned upon. Make a dummy object that exposes the __array_interface__ att

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread Ray S
On 10/9/07, Sebastian Haase replied: > > Did you find that locks > > or semaphores were needed? > Maybe that's why it crashed ;-) !? But for simple use it seems fine. I just did some code (below) that does read/write to the array AFAP, and there is no crash, or any other issue (Win2000, py2.

[Numpy-discussion] Warnings

2007-10-09 Thread Tommy Grav
How can I get the line number of where a numpy warning message is envoked in my code? Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] diff of find of diff trick

2007-10-09 Thread Robin
Hello, As a converting MATLAB user I am bringing over some of my code. A core function I need is to sample the probability distribution of a given set of data. Sometimes these sets are large so I would like to make it as efficient as possible. (the data are integers representing members of a discr

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread Sebastian Haase
On 10/9/07, Ray Schumacher <[EMAIL PROTECTED]> wrote: > At 05:22 AM 10/9/2007, David Cournapeau wrote: > >Could not this be because you compiled the posh sources with a > >compiler/runtime which is different than the other extensions and python > >interpreter ? > > It definitely was - since my 2.4

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread Ray Schumacher
At 05:22 AM 10/9/2007, David Cournapeau wrote: >Could not this be because you compiled the posh sources with a >compiler/runtime which is different than the other extensions and python >interpreter ? It definitely was - since my 2.4 wanted the free 7.1 compiler, I (and anyone else who didn't down

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread David Cournapeau
On 10/9/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: > > > As I recollect, the tag thing was the key for turning the mmap into a > "not really memmaped file", that is, a memmap without a corresponding > file on the disk. All this is windows specific, I have never seen this tag thing on other OS

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread Sebastian Haase
On 10/9/07, David Cournapeau <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > Hi! > > I was in fact experimenting with this. The solution seemed to lie in > > "simple" memmap as it is implemented in Windows: > > > > import numpy as N > > def arrSharedMemory(shape, dtype, tag="PriithonSharedM

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread David Cournapeau
Sebastian Haase wrote: > Hi! > I was in fact experimenting with this. The solution seemed to lie in > "simple" memmap as it is implemented in Windows: > > import numpy as N > def arrSharedMemory(shape, dtype, tag="PriithonSharedMemory"): > """ > Windows only ! > share memory between dif

Re: [Numpy-discussion] beginner question: rank-1 arrays

2007-10-09 Thread Sven Schreiber
Alan G Isaac schrieb: > On Mon, 8 Oct 2007, Robin apparently wrote: >> However in my code (I am converting from MATLAB) it is >> important to maintain 2d arrays, and keep the difference >> between row and column vectors. > > How about using matrices? > help(numpy.mat) > > hth, > Alan Isaac >

Re: [Numpy-discussion] numpy/Windows shared arrays between processes?

2007-10-09 Thread Sebastian Haase
Hi! I was in fact experimenting with this. The solution seemed to lie in "simple" memmap as it is implemented in Windows: import numpy as N def arrSharedMemory(shape, dtype, tag="PriithonSharedMemory"): """ Windows only ! share memory between different processes if same `tag` is used.