Re: [Numpy-discussion] Getting rid of annoying weave nag

2006-06-09 Thread Fernando Perez
On 6/9/06, David M. Cooke [EMAIL PROTECTED] wrote: This difference is so dramatic that I think a message is justified (absent a proper logging framework). It's helpful to know that the time is going into c++ compilation, and not your code hanging for 30 seconds. Ok, I'll give you that

Re: [Numpy-discussion] numpy segv on OpenBSD

2006-06-15 Thread Fernando Perez
On 6/15/06, Damien Miller [EMAIL PROTECTED] wrote: David M. Cooke wrote: Can you update to the latest svn? We may have fixed it already: valgrind is showing up nothing for me. Ok, but dumb question: how do I check out the SVN trunk? Sourceforge lists details for CVS only... (unless I'm

Re: [Numpy-discussion] Array interface updated to Version 3

2006-06-16 Thread Fernando Perez
On 6/16/06, Travis Oliphant [EMAIL PROTECTED] wrote: There is talk of ctypes supporting the new interface which is a worthy development. Please encourage that if you can. That would certainly be excellent, esp. given how ctypes is slated to be officially part of python 2.5. I think it would

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-17 Thread Fernando Perez
On 6/17/06, Francesc Altet [EMAIL PROTECTED] wrote: However, I think that this has its utility, specially when accessing to nested fields (see later). In addition, I'd suggest introducing a special accessor called, say, 'fields' in order to access the fields themselves and not the attributes.

Re: [Numpy-discussion] fread codes versus numpy types

2006-06-28 Thread Fernando Perez
On 6/28/06, Robert Kern [EMAIL PROTECTED] wrote: The Capitalized versions are actually old typecodes for backwards compatibility with Numeric. In recent development versions of numpy, they are no longer exposed except through the numpy.oldnumeric compatibility module. A decision was made

Re: [Numpy-discussion] fread codes versus numpy types

2006-06-28 Thread Fernando Perez
On 6/28/06, David M. Cooke [EMAIL PROTECTED] wrote: On Wed, 28 Jun 2006 11:22:38 -0600 Fernando Perez [EMAIL PROTECTED] wrote: Should I apply this patch, so we push the cleaned-up API even a bit harder? Yes please. I think all the modules that still use the oldnumeric names actually import

Re: [Numpy-discussion] Setuptools leftover junk

2006-06-28 Thread Fernando Perez
On 6/28/06, David M. Cooke [EMAIL PROTECTED] wrote: Done. I've also added a 'setupegg.py' module that wraps running 'setup.py' with an import of setuptools (it's based on the one used in matplotlib). easy_install still works, also. You beat me to it :) However, your patch has slightly

Re: [Numpy-discussion] Time for beta1 of NumPy 1.0

2006-06-30 Thread Fernando Perez
On 6/30/06, Scott Ransom [EMAIL PROTECTED] wrote: +1 for float64 for me as well. +1 for float64 I have lots of code overriding the int defaults by hand which were giving me grief with hand-written extensions (which were written double-only for speed reasons). I'll be happy to clean this up. I

Re: [Numpy-discussion] Time for beta1 of NumPy 1.0

2006-06-30 Thread Fernando Perez
On 6/30/06, Sasha [EMAIL PROTECTED] wrote: On 6/30/06, Fernando Perez [EMAIL PROTECTED] wrote: ... Besides, decent unit tests will catch these problems. We all know that every scientific code in existence is unit tested to the smallest routine, so this shouldn't be a problem for anyone

Re: [Numpy-discussion] NumPy C-API now has prefixes

2006-07-07 Thread Fernando Perez
On 7/7/06, Travis Oliphant [EMAIL PROTECTED] wrote: I just committed a big change to the NumPy SVN (r2773-r2777) which adds the prefix npy_ or NPY_ to all names not otherwise pre-fixed. There is also a noprefix.h header that allows you to use the names without the prefixes defined, as before

[Numpy-discussion] I think something broke badly today in numpy/scipy...

2006-07-07 Thread Fernando Perez
Hi all, I updated earlier today (about 4 hours ago) numpy/scipy SVN, and all of a sudden my codes broke left and right. Backing off to In [3]: numpy.__version__ Out[3]: '0.9.9.2737' In [4]: scipy.__version__ Out[4]: '0.5.0.2044' things are OK again. I am really sorry not to be able to

Re: [Numpy-discussion] I think something broke badly today in numpy/scipy...

2006-07-08 Thread Fernando Perez
On 7/8/06, Travis Oliphant [EMAIL PROTECTED] wrote: Hey Fernando. I think I found the problem. It was the same problem causing the BFGS test to fail in SciPy. [...] The problem should be fixed in SVN. Confirmed. With: numpy version: 0.9.9.2788 scipy version: 0.5.0.2057 I checked on

Re: [Numpy-discussion] bdist_rpm failure

2006-07-12 Thread Fernando Perez
On 7/11/06, Travis Oliphant [EMAIL PROTECTED] wrote: Make sure you get rid of the MANIFEST file in the source directory before trying to run sdist or bdist_rpm. The MANIFEST file is not being deleted when it is dated... Since both numpy/scipy have a MANIFEST.in, this bit of code (from

Re: [Numpy-discussion] Scalars, comparisons and indexing. Is this a bug?

2006-07-14 Thread Fernando Perez
On 7/14/06, Bill Baxter [EMAIL PROTECTED] wrote: I believe that's the problem that the indexing PEP from Travis is supposed to address: http://www.python.org/dev/peps/pep-0357/ So I think there's not much anyone can do about it untill the PEP is accepted and implemented. Maybe you can

[Numpy-discussion] 64-bit build woes

2006-07-17 Thread Fernando Perez
Hi all, I received this message today from a collaborator. I don't have direct access to this box, but he posted fairly detailed logs. Has anyone seen a similar issue with current code? If not, I'll try to track down further with him what the problem may actually be. Thanks for any help, f

Re: [Numpy-discussion] fast way of doing cross-multiplications ?

2006-07-18 Thread Fernando Perez
On 7/18/06, Tim Hochberg [EMAIL PROTECTED] wrote: Eric Emsellem wrote: thanks for the tips. (indeed your add.reduce is correct: I just wrote this down too quickly, in the script I have a sum included). And yes you are right for the memory issue, so I may just keep the loop in and try to

Re: [Numpy-discussion] Please comment on SVN versioning convention

2006-07-24 Thread Fernando Perez
On 7/24/06, Travis Oliphant [EMAIL PROTECTED] wrote: Andrew Straw has emphasized that the current strategy of appending the SVN version number to development versions of the SVN tree makes it hard to do version sorting. His proposal is to not change the version number until the first beta

Re: [Numpy-discussion] Version numbers again

2006-07-27 Thread Fernando Perez
On 7/27/06, Francesc Altet [EMAIL PROTECTED] wrote: Travis, Speaking on what we regularly do, I would choose a 1.0b2.svn_version for the trunk version. This is a way to say people: Hey, you are using a version that will be the 1.0b2 in the future.. Of course, the same meaning can be

Re: [Numpy-discussion] Creating and reshaping fortran order arrays

2006-08-14 Thread Fernando Perez
On 8/14/06, Travis Oliphant [EMAIL PROTECTED] wrote: Travis Oliphant wrote: However, you can use the ndarray creation function itself to do what you want: a = ndarray(shape=(2,2), dtype=int32, buffer=str, order='F') This will use the memory of the string as the new array memory.

Re: [Numpy-discussion] Interesting memory leak

2006-08-18 Thread Fernando Perez
This leak is caused by add_docstring, but it's supposed to leak. I wonder if there's a way to register some kind of on-exit handler in Python so that this can also be cleaned up? import atexit atexit.register(your_cleanup_function) whose api is no args on input: def your_cleanup_function():

Re: [Numpy-discussion] request for new array method: arr.abs()

2006-08-23 Thread Fernando Perez
On 8/23/06, Bill Baxter [EMAIL PROTECTED] wrote: The thing that I find I keep forgetting is that abs() is a built-in, but other simple functions are not. So it's abs(foo), but numpy.floor(foo) and numpy.ceil(foo). And then there's round() which is a built-in but can't be used with arrays, so

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Fernando Perez
On 8/29/06, Charles R Harris [EMAIL PROTECTED] wrote: Speaking of features, I wonder if more of the methods should return references. For instance, it might be nice to write something like: a.sort().searchsorted([...]) instead of making two statements out of it. +1 for more 'return self'

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Fernando Perez
On 8/29/06, David M. Cooke [EMAIL PROTECTED] wrote: On Tue, 29 Aug 2006 14:03:39 -0700 Tim Hochberg [EMAIL PROTECTED] wrote: b = a.sort() # Returns a copy a.sort(out=a) # Sorts a in place a.sort(out=c) # Sorts a into c (probably just equivalent to c = a.sort() in this case since we

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Fernando Perez
On 8/29/06, Travis Oliphant [EMAIL PROTECTED] wrote: Hi all, Classes start for me next Tuesday, and I'm teaching a class for which I will be using NumPy / SciPy extensively. I need to have a release of these two (and hopefully matplotlib) that work with each other. Therefore, I'm going to

[Numpy-discussion] Changing Fatal error into ImportError?

2006-08-30 Thread Fernando Perez
Hi all, this was mentioned in the past, but I think it fell through the cracks: Python 2.3.4 (#1, Mar 10 2006, 06:12:09) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 Type help, copyright, credits or license for more information. import mwadap Overwriting info=function info at 0xb77198b4

Re: [Numpy-discussion] Changing Fatal error into ImportError?

2006-08-30 Thread Fernando Perez
On 8/30/06, Robert Kern [EMAIL PROTECTED] wrote: I don't see where we're calling Py_FatalError. The problem might be in Python or mwadap. Indeed, import_array() raises a PyExc_ImportError. Sorry for the noise: it looks like this was already fixed:

Re: [Numpy-discussion] 1.0b5 build failure

2006-09-09 Thread Fernando Perez
On 9/9/06, Neal Becker [EMAIL PROTECTED] wrote: Sorry, actually that's today's numpy svn - not 1.0b5. Make sure you have a clean build environment, the current SVN builds just fine on my Dapper 6.06 box; I just rebuilt it a second ago. Cheers, f ps. Here's my little build script, which I use

Re: [Numpy-discussion] reload and f2py

2006-09-26 Thread Fernando Perez
On 9/26/06, George Nurser [EMAIL PROTECTED] wrote: I'm running Python 2.3.5 with recent SVN f2py. Suppose I import an extension I have built with f2py. Then, if I edit the fortran and recompile the extension, I cannot use reload to use the modified version within the same Python session. I

Re: [Numpy-discussion] contribution about history of Numeric

2006-10-05 Thread Fernando Perez
On 10/5/06, Paul Dubois [EMAIL PROTECTED] wrote: I was reading the 'History of SciPy' page and noticed the discussion about Numeric. Here's the true story about why the various names for the original: numpy, Numeric, Numerical. I added this to the wiki page

[Numpy-discussion] A mean docstring?

2006-10-10 Thread Fernando Perez
Hi all, I was updating some old Numeric code to be more 'numpythonic' (it works, but uses a lot of Numeric-style cruft), and read the a.mean() docstring that says: If axis is None, this equals: a.sum(axis, dtype) * 1.0 / product(a.shape,axis=0) Is this convoluted form of the

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Fernando Perez
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Could sqrt(-1) made to return 1j again? Not in NumPy. But, in scipy it could. Without taking sides on which way to go, I'd like to -1 the idea of a difference in behavior between numpy and scipy. IMHO, scipy

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Fernando Perez
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote: Fernando Perez wrote: IMHO, scipy should be within reason a strict superset of numpy. This was not the relationship of scipy to Numeric. For me, it's the fact that scipy *used* to have the behavior that scipy.sqrt(-1) return 1j

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Fernando Perez
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote: Fernando Perez wrote: There are people who import scipy for everything, others distinguish between numpy and scipy, others use numpy alone and at some point in their life's code they do import numpy as N - import scipy as N because

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-12 Thread Fernando Perez
On 10/12/06, Travis Oliphant [EMAIL PROTECTED] wrote: Why in the world does it scare you away. This makes no sense to me. If you don't like the scipy version don't use it. NumPy and SciPy are not the same thing. I'd like to pitch in (again) on this issue, but I'll try to make sure that

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-23 Thread Fernando Perez
On 10/23/06, Travis Oliphant [EMAIL PROTECTED] wrote: Fernando Perez wrote: Hi all, two colleagues have been seeing occasional crashes from very long-running code which uses numpy. We've now gotten a backtrace from one such crash, unfortunately it uses a build from a few days ago

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-23 Thread Fernando Perez
On 10/23/06, Travis Oliphant [EMAIL PROTECTED] wrote: Fernando Perez wrote: If you point me to the right place in the sources, I'll be happy to add something to my local copy, rebuild numpy and rerun with these print statements in place. I've placed them in SVN (r3384): [...] Great

Re: [Numpy-discussion] pyaudio, a module to make noise from numpy arrays

2006-10-27 Thread Fernando Perez
On 10/27/06, David L. Goldsmith [EMAIL PROTECTED] wrote: I'm sure some others _might_ regard this as frivolous, so let me just say: Way Cool! Thanks! +1, and not frivolous at all. It's /really/ neat to be able to pull in data from standard image formats (say jpeg) into arrays to quickly do

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Fernando Perez
On 10/30/06, David Huard [EMAIL PROTECTED] wrote: Hi, I have a script that crashes, but only if it runs over 9~10 hours, with the following backtrace from gdb. The script uses PyMC, and repeatedly calls ( 100) likelihood functions written in fortran and wrapped with f2py. Numpy:

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Fernando Perez
On 10/23/06, Travis Oliphant [EMAIL PROTECTED] wrote: I've placed them in SVN (r3384): arraydescr_dealloc needs to do something like. if (self-fields == Py_None) { print something incref(self) return; } Here is some more info. We left a long-running job over the weekend with

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Fernando Perez
On 10/30/06, Travis Oliphant [EMAIL PROTECTED] wrote: David Huard wrote: Ok, I'll update numpy and give it another try tonight. I just fixed some reference-count problems in f2py today. These were of the variety that there was a missing decref that would cause the reference count of

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Fernando Perez
On 10/30/06, Lisandro Dalcin [EMAIL PROTECTED] wrote: FYI, this is what is defined in Include/object.h /* PyObject_HEAD defines the initial segment of every PyObject. */ #define PyObject_HEAD \ _PyObject_HEAD_EXTRA\ Py_ssize_t ob_refcnt;

Re: [Numpy-discussion] [SciPy-user] Need more comments from scientific community on python-dev

2006-10-31 Thread Fernando Perez
On 10/31/06, Travis Oliphant [EMAIL PROTECTED] wrote: Fernando Perez wrote: I actually worry about the same: I really would like to help, but after reading the whole discussion, I realized that the low-level details being asked and discussed are something I don't really know enough to say

Re: [Numpy-discussion] installing numpy on Tiger

2006-10-31 Thread Fernando Perez
On 10/31/06, Alan Isaac [EMAIL PROTECTED] wrote: If other users will not profit from this question, please consider it OT and ignore it. But perhaps it will prove useful to some potential numpy users. I am a long time Windows user who has been happily using the Python and numpy installers.

Re: [Numpy-discussion] numpy.random.ranomd_integers returning only negative numbers ?

2006-11-01 Thread Fernando Perez
On 11/1/06, David Cournapeau [EMAIL PROTECTED] wrote: Hi, I want to generate some random integers,let's say in the range [- 2^15, 2^16]. Why doing: noise = numpy.random.random_integers(- (2 ** 15), (2 * 15), 22050) gives only negative numbers ? In [3]: noise =

Re: [Numpy-discussion] [SciPy-user] [ANN[ pysamplerate, a library to do high quality samplerate convertion

2006-11-01 Thread Fernando Perez
On 11/2/06, David Cournapeau [EMAIL PROTECTED] wrote: (if those announcements are not welcome on the lists, please tell me) Frankly, if an announcement for a free Python signal processing library is not welcome on the scipy lists, I don't know where it would be ;) As a minor note though: please

Re: [Numpy-discussion] numpy book

2006-11-02 Thread Fernando Perez
On 11/2/06, Travis Oliphant [EMAIL PROTECTED] wrote: Thanks for the pre-amble. Does it require pdflatex? I use ps2pdf because to generate the shaded boxes and graphics. I could probably try to do it with pdflatex and png files but I haven't tried, yet. I just tested it with ps2pdf on a

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-11-06 Thread Fernando Perez
On 10/23/06, Travis Oliphant [EMAIL PROTECTED] wrote: I've placed them in SVN (r3384): arraydescr_dealloc needs to do something like. if (self-fields == Py_None) { print something incref(self) return; } Travis, I know you're busy right now, so this message is just so that

[Numpy-discussion] Profiling Python codes with hotshot and KCachegrind

2006-11-08 Thread Fernando Perez
Hi all, in the past, Arnd Baecker has made a number of very useful posts on this matter, and provided some nice utilities to do it. I now needed to profile some fairly complex codes prior to a big optimization push, so I went over his material and wrote a little tool to make the whole process as

Re: [Numpy-discussion] Profiling Python codes with hotshot and KCachegrind

2006-11-08 Thread Fernando Perez
On 11/8/06, Stefan van der Walt [EMAIL PROTECTED] wrote: This looks very interesting. It works for me on simple scripts, but whenever I include the lines from numpy.testing import set_local_path set_local_path('../../..') in the input, pycachegrind aborts with File

Re: [Numpy-discussion] Int32s, scalar operations and Pyhon longs

2006-11-09 Thread Fernando Perez
On 11/9/06, Robert Kern [EMAIL PROTECTED] wrote: Fernando Perez wrote: I understand why this happens, but I wonder if it should be in any way 'fixed' (if that is even feasible without introducing other problems): [...] I am sure it will be, to say the least, pretty surprising (and I can

Re: [Numpy-discussion] Int32s, scalar operations and Pyhon longs

2006-11-09 Thread Fernando Perez
On 11/9/06, Tim Hochberg [EMAIL PROTECTED] wrote: Let me add that I can't imagine that the bugs will be all that subtle given that numpy now spits out a warning on overflow. If you're really worried about this I suggest you crank up the error mode to make this an error - then you really won't

[Numpy-discussion] [OT] Why Python 'fits your brain'

2006-11-09 Thread Fernando Perez
Please forgive the not-specifically-numpy post. I'll keep it short. Some of us often, when trying to explain to newcomers the benefits of Python for scientific work, use expressions like the famous 'it fits your brain'. This is an attempt at conveying why it seems like such a natural tool for