Re: [Numpy-discussion] searchsorted() and memory cache

2008-05-14 Thread Andrew Straw
Aha, I've found the problem -- my values were int64 and my keys were uint64. Switching to the same data type immediately fixes the issue! It's not a memory cache issue at all. Perhaps searchsorted() should emit a warning if the keys require casting... I can't believe how bad the hit was. -Andrew

Re: [Numpy-discussion] let's use patch review

2008-05-14 Thread David Cournapeau
On Wed, 2008-05-14 at 13:58 -1000, Eric Firing wrote: > > What does that mean? How does one know when there is a consensus? There can be a system to make this automatic. For example, the code is never commited directly to svn, but to a gatekeeper, and people vote by an email command to say if th

Re: [Numpy-discussion] let's use patch review

2008-05-14 Thread Ondrej Certik
On Thu, May 15, 2008 at 1:58 AM, Eric Firing <[EMAIL PROTECTED]> wrote: > Ondrej Certik wrote: >> Hi, >> >> I read the recent flamebate about unittests, formal procedures for a >> commit etc. and it was amusing. :) >> I think Stefan is right about the unit tests. I also think that Travis >> is righ

Re: [Numpy-discussion] embedded PyArray_FromDimsAndDataSegmentationFault

2008-05-14 Thread Thomas Hrabe
>But for the most part, it's much better to drive your C code using >Python than the other around. True, the other way arround works fine. Will investigate further tomorrow, because its a must have feature... Thanks <>___ Numpy-discussion mailing list

Re: [Numpy-discussion] embedded PyArray_FromDimsAndDataSegmentation Fault

2008-05-14 Thread Robert Kern
On Wed, May 14, 2008 at 6:40 PM, Thomas Hrabe <[EMAIL PROTECTED]> wrote: >>I didn't know a person could write a stand-alone program using NumPy >>this way (can you?) > > Well, this is possible when you embed python and use the "simple" objects > such as ints, strings, > Why should it be impos

Re: [Numpy-discussion] let's use patch review

2008-05-14 Thread Eric Firing
Ondrej Certik wrote: > Hi, > > I read the recent flamebate about unittests, formal procedures for a > commit etc. and it was amusing. :) > I think Stefan is right about the unit tests. I also think that Travis > is right that there is no formal procedure that can assure what we > want. > > I thin

Re: [Numpy-discussion] embedded PyArray_FromDimsAndDataSegmentation Fault

2008-05-14 Thread Thomas Hrabe
>I didn't know a person could write a stand-alone program using NumPy >this way (can you?) Well, this is possible when you embed python and use the "simple" objects such as ints, strings, Why should it be impossible to do it for numpy then? My plan is to send multidimensional arrays from C t

Re: [Numpy-discussion] searchsorted() and memory cache

2008-05-14 Thread Charles R Harris
On Wed, May 14, 2008 at 2:00 PM, Andrew Straw <[EMAIL PROTECTED]> wrote: > Charles R Harris wrote: > > > > > > On Wed, May 14, 2008 at 8:09 AM, Andrew Straw <[EMAIL PROTECTED] > > > wrote: > > > > > > > > Quite a difference (a factor of about 3000)! At this point, I h

Re: [Numpy-discussion] embedded PyArray_FromDimsAndData Segmentation Fault

2008-05-14 Thread Stéfan van der Walt
Hi Thomas 2008/5/15 Thomas Hrabe <[EMAIL PROTECTED]>: > PyArray_FromDimsAndData(dimensions,size,NPY_DOUBLELTR,(char*)value); > //TROUBLE HERE I didn't know a person could write a stand-alone program using NumPy this way (can you?); but what I do know is that FromDimsAndData is deprecated, and th

Re: [Numpy-discussion] embedded PyArray_FromDimsAndData Segmentation Fault

2008-05-14 Thread Robert Kern
On Wed, May 14, 2008 at 5:42 PM, Thomas Hrabe <[EMAIL PROTECTED]> wrote: > > Hi all, > > the PyArray_FromDimsAndData is still cousing me headaches. > > Is there anybody out there finding the error of the following code? > > #include "Python.h" > #include > int main(int argc,char** argv) > { > >

[Numpy-discussion] embedded PyArray_FromDimsAndData Segmentation Fault

2008-05-14 Thread Thomas Hrabe
Hi all, the PyArray_FromDimsAndData is still cousing me headaches. Is there anybody out there finding the error of the following code? #include "Python.h" #include int main(int argc,char** argv) { int dimensions = 2; void* value = malloc(sizeof(double)*100); int* si

Re: [Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-14 Thread Robert Kern
On Wed, May 14, 2008 at 3:20 PM, David Huard <[EMAIL PROTECTED]> wrote: > I filed a patch that seems to do the trick in ticket #792. I don't think this is the right approach. The problem isn't that _FORTIFY_SOURCE is set to 2 but that f2py is doing (probably) bad things that trip these buffer over

[Numpy-discussion] let's use patch review

2008-05-14 Thread Ondrej Certik
Hi, I read the recent flamebate about unittests, formal procedures for a commit etc. and it was amusing. :) I think Stefan is right about the unit tests. I also think that Travis is right that there is no formal procedure that can assure what we want. I think that a solution is a patch review. Ev

Re: [Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-14 Thread David Huard
I filed a patch that seems to do the trick in ticket #792. 2008/5/14 David Huard <[EMAIL PROTECTED]>: > Hi, > > On fedora 8, the docstrings of f2py generated extensions are strangely > missing. On Ubuntu, the same modules do have the docstrings. The probl

Re: [Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-14 Thread Robert Kern
On Wed, May 14, 2008 at 2:46 PM, David Huard <[EMAIL PROTECTED]> wrote: > Hi, > > On fedora 8, the docstrings of f2py generated extensions are strangely > missing. On Ubuntu, the same modules do have the docstrings. The problem, as > reported in the f2py ML, seems to come from the -D_FORTIFY_SOURCE

Re: [Numpy-discussion] searchsorted() and memory cache

2008-05-14 Thread Andrew Straw
Charles R Harris wrote: > > > On Wed, May 14, 2008 at 8:09 AM, Andrew Straw <[EMAIL PROTECTED] > > wrote: > > > > Quite a difference (a factor of about 3000)! At this point, I haven't > delved into the dataset to see what makes it so pathological -- > performan

Re: [Numpy-discussion] Extending an ndarray

2008-05-14 Thread Søren Nielsen
Thanks alan, that works! Soren On Wed, May 14, 2008 at 9:02 PM, Alan McIntyre <[EMAIL PROTECTED]> wrote: > Here's one way (probably not the most efficient or elegant): > > # example original array > a=arange(1,26).reshape(5,5) > > # place copy of 'a' into upper left corner of a larger array of z

[Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-14 Thread David Huard
Hi, On fedora 8, the docstrings of f2py generated extensions are strangely missing. On Ubuntu, the same modules do have the docstrings. The problem, as reported in the f2py ML, seems to come from the -D_FORTIFY_SOURCE flag which is set to 2 instead of 1. Could this be fixed in numpy.distutils and

Re: [Numpy-discussion] searchsorted() and memory cache

2008-05-14 Thread Charles R Harris
On Wed, May 14, 2008 at 8:09 AM, Andrew Straw <[EMAIL PROTECTED]> wrote: > > > I will post any new insights as I continue to work on this... > > > OK, I save isolated a sample of my data that illustrates the terrible > performance with the binarysearch. I have uploaded it as a pytables file > to h

Re: [Numpy-discussion] Extending an ndarray

2008-05-14 Thread Alan McIntyre
Here's one way (probably not the most efficient or elegant): # example original array a=arange(1,26).reshape(5,5) # place copy of 'a' into upper left corner of a larger array of zeros b=zeros((10,10)) b[:5,:5]=a On Wed, May 14, 2008 at 2:48 PM, Søren Nielsen <[EMAIL PROTECTED]> wrote: > Hi, > >

[Numpy-discussion] Extending an ndarray

2008-05-14 Thread Søren Nielsen
Hi, I've loaded an image into a ndarray. I'd like to extend the ndarray with a border of zeros all around the ndarray.. does anyone here know how to do this? Thanks, Soren ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scip

Re: [Numpy-discussion] how to use masked arrays

2008-05-14 Thread Pierre GM
On Wednesday 14 May 2008 13:19:55 Eric Firing wrote: > Pierre GM wrote: > > (almost) equivalent [1]: > mydata._data > mydata.view(np.ndarray) > > Shouldn't the former be discouraged, on the grounds that a leading > underscore, by Python convention, indicates an attribute that is not > par

Re: [Numpy-discussion] how to use masked arrays

2008-05-14 Thread Eric Firing
Pierre GM wrote: [...] > > * If you want to access the underlying data directly, these two commands are > (almost) equivalent [1]: mydata._data mydata.view(np.ndarray) Shouldn't the former be discouraged, on the grounds that a leading underscore, by Python convention, indicates an att

Re: [Numpy-discussion] HASH TABLES IN PYTHON

2008-05-14 Thread Robert Kern
On Wed, May 14, 2008 at 10:20 AM, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > To Whom It May Concern, > > I was wondering if anyone has ever worked with hash tables within the Python > Programming language? I will need to utilize this ability for quick > numerical calculations. Yes. Python di

Re: [Numpy-discussion] how to use masked arrays

2008-05-14 Thread Pierre GM
On Wednesday 14 May 2008 02:18:06 Christopher Burns wrote: > I'm finding it difficult to tell which methods/operations respect the > mask and which do not, in masked arrays. Christopher, Unfortunately, there's no tutorial yet. Perhaps could you get one started on the scipy wiki ? I'm afraid I wo

[Numpy-discussion] HASH TABLES IN PYTHON

2008-05-14 Thread Blubaugh, David A.
To Whom It May Concern, I was wondering if anyone has ever worked with hash tables within the Python Programming language? I will need to utilize this ability for quick numerical calculations. Thank You, David Blubaugh This e-mail transmission contains information that is confidential

Re: [Numpy-discussion] searchsorted() and memory cache

2008-05-14 Thread Andrew Straw
Andrew Straw wrote: > I have uploaded it as a pytables file to http://astraw.com/framenumbers.h5 Ahh, forgot to mention a potentially important point -- this data file is 191 MB. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://project

Re: [Numpy-discussion] searchsorted() and memory cache

2008-05-14 Thread Andrew Straw
> I will post any new insights as I continue to work on this... > OK, I save isolated a sample of my data that illustrates the terrible performance with the binarysearch. I have uploaded it as a pytables file to http://astraw.com/framenumbers.h5 in case anyone wants to have a look themselves. H

Re: [Numpy-discussion] 1.1 dev on the trunk and the road to 1.2

2008-05-14 Thread Charles R Harris
On Wed, May 14, 2008 at 1:47 AM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > Eric Firing wrote: > > Jarrod Millman wrote: > > > >> On Tue, May 13, 2008 at 9:39 PM, Charles R Harris > >> <[EMAIL PROTECTED]> wrote: > >> > >>> I was getting ready to add a big code cleanup, so you lucked out ;) >

Re: [Numpy-discussion] Trac internal error

2008-05-14 Thread Pauli Virtanen
ti, 2008-05-13 kello 23:00 -0700, Jarrod Millman kirjoitti: > On Tue, May 13, 2008 at 1:37 AM, Pauli Virtanen <[EMAIL PROTECTED]> wrote: > > Something seems to be wrong with the Trac: > > > > http://scipy.org/scipy/numpy/timeline > > > > Internal Error > > Ticket changes event provider (TicketM

[Numpy-discussion] mac osx10.5 and external library crash (possible f2py/numpy problem?)

2008-05-14 Thread Garry Willgoose
I've just moved all my stuff from a Intel Imac on 10.4.11 to a Macpro on 10.5.2. On both machines I have the same universal activestate python (both 2.5.1 and 2.5.2.2 give the same problem). I have some codes in fortran from which I build a shared library using f2py from numpy. Now when I i

Re: [Numpy-discussion] 1.1 dev on the trunk and the road to 1.2

2008-05-14 Thread Travis E. Oliphant
Eric Firing wrote: > Jarrod Millman wrote: > >> On Tue, May 13, 2008 at 9:39 PM, Charles R Harris >> <[EMAIL PROTECTED]> wrote: >> >>> I was getting ready to add a big code cleanup, so you lucked out ;) Let's >>> get this release out as quickly as possible once masked arrays are ready to >>