Re: ? on scipy.fftpack

2006-06-28 Thread Mike Duffy
Oops, sorry. I see what you mean. I was reading the docs for the regular (complex) fft function, since that was what I was initially having the bug with. I was just using the rfft to simplify things, but I guess that was ironic. Anyway, I appreciate your help and don't mean to burden you. Again, I

Re: ? on scipy.fftpack

2006-06-28 Thread Mike Duffy
Robert Kern wrote: > You will probably want to ask scipy questions on scipy-user. There aren't many > scipy people here. > >http://www.scipy.org/Mailing_Lists > > I haven't run your code, yet, but one of the things you are running into is > the > FFT packing convention for FFTs on real functi

? on scipy.fftpack

2006-06-28 Thread Mike Duffy
I've been debugging a simulation I wrote a while ago, and it seems that the problem is in the fft module itself. I'm trying a simple test by just feeding the function a basic real gaussian. Obviously, I should get back the same real gaussian, but what I get is not even close. Can anyone help me? Th

Re: Specifing arguments type for a function

2006-06-21 Thread Mike Duffy
Paolo Pantaleo wrote: > I have a function > > def f(the_arg): > ... > > and I want to state that the_arg must be only of a certain type > (actually a list). Is there a way to do that? I wrote a cool function decorator just for that purpose. It's posted on the Python Decorator Library at: http://w

Re: Legitimate use of the "is" comparison operator?

2006-06-17 Thread Mike Duffy
Gary Herron wrote: > > >>> 100 is (99+1) > False > > >>> 2 is (1+1) > True > > >>> 100 is 100 > True > > This is highly implementation dependent. The current (C) implementation > of Python has a cache for small integers, so the attempt to compare > values with "is" works for some small integers, an

Re: Legitimate use of the "is" comparison operator?

2006-06-17 Thread Mike Duffy
Fredrik Lundh wrote: > > except that it doesn't work. > > writing broken code is never a good practice. > With all due respect, for some reason it seems to work on my machine. Because I certainly agree with you about writing broken code. Python 2.4.2 (#1, Jan 17 2006, 16:52:02) [GCC 4.0.0 20041026

Legitimate use of the "is" comparison operator?

2006-06-17 Thread Mike Duffy
I just recently realized that the comparison operator "is" actually works for comparing numeric values. Now, I know that its intended use is for testing object identity, but I have used it for a few other things, such as type checking, and I was just wondering whether or not it is considered bad pr