Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread Vincent Schut
David Huard wrote: > > > On Mon, Aug 4, 2008 at 1:45 PM, Jarrod Millman <[EMAIL PROTECTED] > > wrote: > > Question: Should histogram raise a warning by default (new=True) to warn > users that the behaviour has changed ? Or warn only if new=False to > remind that >

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-05 Thread David Cournapeau
On Tue, Aug 5, 2008 at 1:29 AM, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > David, I second your approach. Furthermore, look how SWIG handles > this, it is very similar to your proposal. The difference is that SWIG > uses SWIGUNUSED for some autogenerated functions. Furthermore, it > seems the SWI

[Numpy-discussion] Bilateral filter

2008-08-05 Thread Nadav Horesh
Attached here my cython implementation of the bilateral filter, which is my first cython program. I would ask for the following: 1. Is there any way to speed up the code just by "cosmetic" modifications? 2. In particular I use the unportable gcc function __builtin_abs: I

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-05 Thread Charles R Harris
On Tue, Aug 5, 2008 at 4:28 AM, David Cournapeau <[EMAIL PROTECTED]> wrote: > On Tue, Aug 5, 2008 at 1:29 AM, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > > David, I second your approach. Furthermore, look how SWIG handles > > this, it is very similar to your proposal. The difference is that SWIG

Re: [Numpy-discussion] running numpy tests

2008-08-05 Thread Andrew Dalke
On Aug 5, 2008, at 4:19 AM, Robert Kern wrote: > def test(...): > ... > test.__test__ = False That did it - thanks! Does "import numpy; numpy.bench()" work for anyone? When I try it I get [josiah:~] dalke% python -c 'import numpy; numpy.bench()' ---

Re: [Numpy-discussion] running numpy tests

2008-08-05 Thread Alan McIntyre
At the moment, bench() doesn't work. That's something I'll try to look at this week, but from Friday until the 15th I'm going to be driving most of the time and may not get as much done as I'd like. On 8/5/08, Andrew Dalke <[EMAIL PROTECTED]> wrote: > On Aug 5, 2008, at 4:19 AM, Robert Kern wrote

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-05 Thread Lisandro Dalcin
Of course, you could also call GCC like this '-Wall -Wno-unused-parameter'. Then you will only get warnings about unused functions and local variables. On Tue, Aug 5, 2008 at 9:49 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Tue, Aug 5, 2008 at 4:28 AM, David Cournapeau <[EMAIL PROTECT

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread David Huard
On Tue, Aug 5, 2008 at 4:04 AM, Vincent Schut <[EMAIL PROTECTED]> wrote: > David Huard wrote: > > > > > > On Mon, Aug 4, 2008 at 1:45 PM, Jarrod Millman <[EMAIL PROTECTED] > > > wrote: > > > > > > Question: Should histogram raise a warning by default (new=True) to warn >

Re: [Numpy-discussion] "import numpy" is slow

2008-08-05 Thread Andrew Dalke
I just added ticket 874 http://scipy.org/scipy/numpy/ticket/874 which on my machine takes the import time from 0.15 seconds down to 0.093 seconds. A bit over a month ago it was about 0.33 seconds. :) The biggest trick I didn't apply was to defer importing the re module, and only compile

Re: [Numpy-discussion] running numpy tests

2008-08-05 Thread Andrew Dalke
On Aug 5, 2008, at 3:53 PM, Alan McIntyre wrote: > At the moment, bench() doesn't work. That's something I'll try to > look at this week, but from Friday until the 15th I'm going to be > driving most of the time and may not get as much done as I'd like. Thanks for the confirmation. The import sp

Re: [Numpy-discussion] member1d and unique elements

2008-08-05 Thread Robert Cimrman
Greg Novak wrote: > I have two arrays of integers, and would like to know _where_ they > have elements in common, not just _which_ elements are in common. > This is because the entries in the integer array are aligned with > other arrays. This seems very close to what member1d advertises as > its

Re: [Numpy-discussion] Bilateral filter

2008-08-05 Thread Zachary Pincus
> Attached here my cython implementation of the bilateral filter, > which is my first cython program. I would ask for the following: Thanks for the code! I know it will be of use to me. (Do you place any particular license on it?) Zach On Aug 5, 2008, at 9:38 AM, Nadav Horesh wrote: > Atta

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread Jarrod Millman
On Tue, Aug 5, 2008 at 8:48 AM, David Huard <[EMAIL PROTECTED]> wrote: > Thanks for the feedback. Here is what will be printed: > > If new=False > > The original semantics of histogram is scheduled to be > deprecated in NumPy 1.3. The new semantics fixes > long-standing issues with outliers handlin

[Numpy-discussion] 64bit issue?

2008-08-05 Thread Charles Doutriaux
Hello I'm running into some strange error on a 64bit machine, I tracked it down to this line returning a NULL pointer, any idea why is this? I tried both numpy1.1.1 and what in trunk, numpy.test() passes for both Ok here's the uname of the machine and the offending line: Linux quartic.txcorp.com

Re: [Numpy-discussion] Bilateral filter

2008-08-05 Thread Jarrod Millman
On Tue, Aug 5, 2008 at 9:29 AM, Zachary Pincus <[EMAIL PROTECTED]> wrote: >> Attached here my cython implementation of the bilateral filter, >> which is my first cython program. I would ask for the following: > > Thanks for the code! I know it will be of use to me. (Do you place any > particular li

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread Stéfan van der Walt
2008/8/5 Jarrod Millman <[EMAIL PROTECTED]>: >> If new=None (default) Could you put in a check for new=True, and suppress those messages? A user that knows about the changes wouldn't want to see anything. Regards Stéfan ___ Numpy-discussion mailing li

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread Jarrod Millman
On Tue, Aug 5, 2008 at 10:24 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > Could you put in a check for new=True, and suppress those messages? A > user that knows about the changes wouldn't want to see anything. Yes, that is all ready available. Maybe the warning message for 'new=None' sh

Re: [Numpy-discussion] member1d and unique elements

2008-08-05 Thread Greg Novak
Argh. I could swear that yesterday I typed test cases just like the one you provide, and it behaved correctly. Nevertheless, it clearly fails in spite of my memory, so attached is a version which I believe gives the correct behavior. Greg On Tue, Aug 5, 2008 at 9:00 AM, Robert Cimrman <[EMAIL P

Re: [Numpy-discussion] Bilateral filter

2008-08-05 Thread Nadav Horesh
As much as I know, the python's community is bound to the BSD style licence. I was hoping that the code would be included in scipy, after I would attach the required declaration (I do not know which), and maybe with some adjustment to the coding style. In short, for the next few days I am waiti

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread David Huard
On Tue, Aug 5, 2008 at 1:18 PM, Jarrod Millman <[EMAIL PROTECTED]> wrote: > On Tue, Aug 5, 2008 at 8:48 AM, David Huard <[EMAIL PROTECTED]> wrote: > > Thanks for the feedback. Here is what will be printed: > > > > If new=False > > > > The original semantics of histogram is scheduled to be > > depr

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread David Huard
On Tue, Aug 5, 2008 at 1:36 PM, Jarrod Millman <[EMAIL PROTECTED]> wrote: > On Tue, Aug 5, 2008 at 10:24 AM, Stéfan van der Walt <[EMAIL PROTECTED]> > wrote: > > Could you put in a check for new=True, and suppress those messages? A > > user that knows about the changes wouldn't want to see anythi

Re: [Numpy-discussion] 64bit issue?

2008-08-05 Thread Charles R Harris
On Tue, Aug 5, 2008 at 12:20 PM, Charles Doutriaux <[EMAIL PROTECTED]>wrote: > Hello I'm running into some strange error on a 64bit machine, > I tracked it down to this line returning a NULL pointer, any idea why is > this? > I tried both numpy1.1.1 and what in trunk, numpy.test() passes for both

Re: [Numpy-discussion] "import numpy" is slow

2008-08-05 Thread Christopher Barker
Robert Kern wrote: > > It's still pretty bad, though. I do recommend running Disk Repair like Bill > did. I did that, and it found and did nothing -- I suspect it ran when I re-booted -- it did take a while to reboot. However, this is pretty consistently what I'm getting now: $ time python -

Re: [Numpy-discussion] 64bit issue?

2008-08-05 Thread Charles Doutriaux
Hi chuck, works great on 32bit int *dims; dims = (int *)malloc(self->nd*sizeof(int)); and self->nd is 3 C. Charles R Harris wrote: > > > On Tue, Aug 5, 2008 at 12:20 PM, Charles Doutriaux > <[EMAIL PROTECTED] > wrote: > > Hello I'm running into some strange

Re: [Numpy-discussion] 64bit issue?

2008-08-05 Thread Charles R Harris
On Tue, Aug 5, 2008 at 1:14 PM, Charles Doutriaux <[EMAIL PROTECTED]>wrote: > Hi chuck, works great on 32bit > > int *dims; >dims = (int *)malloc(self->nd*sizeof(int)); > > and self->nd is 3 > Should be npy_intp *dims; npy_intp will be 32 bits/ 64 bits depending on the architecture, ints t

Re: [Numpy-discussion] 64bit issue?

2008-08-05 Thread Charles Doutriaux
Wow! It did it! Is there other little tricks like this one I should track? Thanks a lot! It would have take me days to track this one! C. Charles R Harris wrote: > > > On Tue, Aug 5, 2008 at 1:14 PM, Charles Doutriaux <[EMAIL PROTECTED] > > wrote: > > Hi chuck, w

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread Jarrod Millman
On Tue, Aug 5, 2008 at 10:58 AM, David Huard <[EMAIL PROTECTED]> wrote: > The roadmap that I propose is the following: > > 1.1 we warn about upcoming change, (new=False) > 1.2 we make that change, (new=None) + warnings > 1.3 we deprecate the old behaviour (new=True), no warnings. > 1.4 remove the o

Re: [Numpy-discussion] Bilateral filter

2008-08-05 Thread Alan G Isaac
On Tue, 5 Aug 2008, Nadav Horesh apparently wrote: > As much as I know, the python's community is bound to the > BSD style licence. I was hoping that the code would be > included in scipy, after I would attach the required > declaration (I do not know which), and maybe with some > adjustment to

Re: [Numpy-discussion] 64bit issue?

2008-08-05 Thread Charles R Harris
On Tue, Aug 5, 2008 at 1:45 PM, Charles Doutriaux <[EMAIL PROTECTED]>wrote: > Wow! It did it! > > Is there other little tricks like this one I should track? > The main change from the deprecated compatibility functions to the new functions is the replacement of int *dims; by npy_intp *dims;

[Numpy-discussion] Error creating an array

2008-08-05 Thread Sameer DCosta
Im having a little trouble creating a numpy array with a specific dtype. I can create the array b with dtype=int, but not with the dtype I want. Any idea what I am doing wrong here? In [450]: import numpy as np In [451]: print np.__version__ 1.2.0.dev5243 In [452]: dtype=np.dtype([('spam', ' 1

Re: [Numpy-discussion] Error creating an array

2008-08-05 Thread Travis E. Oliphant
Sameer DCosta wrote: > Im having a little trouble creating a numpy array with a specific > dtype. I can create the array b with dtype=int, but not with the dtype > I want. Any idea what I am doing wrong here? > You must uses tuples for the individual "records" when constructing arrays with the

Re: [Numpy-discussion] Error creating an array

2008-08-05 Thread Sameer DCosta
On Tue, Aug 5, 2008 at 2:35 PM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > You must uses tuples for the individual "records" when constructing > arrays with the "array" command. Thanks Travis. Is there a reason why numpy insists on tuples? Anyway, moving on, this brings me to the real proble

Re: [Numpy-discussion] Error creating an array

2008-08-05 Thread Travis E. Oliphant
Sameer DCosta wrote: > On Tue, Aug 5, 2008 at 2:35 PM, Travis E. Oliphant > <[EMAIL PROTECTED]> wrote: > > >> You must uses tuples for the individual "records" when constructing >> arrays with the "array" command. >> > > Thanks Travis. Is there a reason why numpy insists on tuples? > Yea

Re: [Numpy-discussion] Bilateral filter

2008-08-05 Thread Travis E. Oliphant
Nadav Horesh wrote: > Attached here my cython implementation of the bilateral filter, which > is my first cython program. I would ask for the following: > >1. Is there any way to speed up the code just by "cosmetic" > modifications? >2. In particular I use the unportable gcc function

[Numpy-discussion] Changeset 5609 of numpy breaks scipy build

2008-08-05 Thread Fernando Perez
Howdy, I just noticed that scipy wasn't building via my little script that does a numpy/mpl/scipy svn update+clean build. Chris Burn's excellent hunch pinpointed the culprit: http://projects.scipy.org/scipy/numpy/changeset/5609 Innocent looking as it may be, with numpy after that revision, bui

Re: [Numpy-discussion] Changeset 5609 of numpy breaks scipy build

2008-08-05 Thread David Cournapeau
On Wed, Aug 6, 2008 at 8:20 AM, Fernando Perez <[EMAIL PROTECTED]> wrote: > Howdy, > > I just noticed that scipy wasn't building via my little script that > does a numpy/mpl/scipy svn update+clean build. That would be me. I forgot to take into account C++ in this change. Looking at it cheers, Da

Re: [Numpy-discussion] Changeset 5609 of numpy breaks scipy build

2008-08-05 Thread David Cournapeau
On Wed, Aug 6, 2008 at 8:36 AM, David Cournapeau <[EMAIL PROTECTED]> wrote: > On Wed, Aug 6, 2008 at 8:20 AM, Fernando Perez <[EMAIL PROTECTED]> wrote: >> Howdy, >> >> I just noticed that scipy wasn't building via my little script that >> does a numpy/mpl/scipy svn update+clean build. > > That woul

Re: [Numpy-discussion] Bilteral filter

2008-08-05 Thread Jarrod Millman
2008/8/3 Nadav Horesh <[EMAIL PROTECTED]>: > I'll post the code in this mailing list, and hope it would find a good home. Excellent. It would be great to get this into SciPy. Perhaps there is even code in David Bolme's project that he might be interested in pushing upstream. -- Jarrod Millman

[Numpy-discussion] Horizontal lines in diffraction image (NumPy FFT)

2008-08-05 Thread Matthias Hillenbrand
Hello, I am trying to calculate the propagation of a Gaussian beam with an angular spectrum propagation algorithm. My program does the following steps: 1. Generation and multiplication of the Gaussian beam, an aperture, and a lens -> u 2. FFT(u) 3. Multiplication of FFT(u) with the angular spectru