Re: [Numpy-discussion] numpy and math sqrt timings

2007-12-28 Thread Matthieu Brucher
Hi, This is a know fact, you should use Python default functions if you have only one value. If Numpy uses math.sqrt for floatting point number, it would have to use cmath for complex values as well. Now, I don't know if an additionnal test will slow down Numpy, if this is the case, then we should

[Numpy-discussion] numpy and math sqrt timings

2007-12-28 Thread Bruce Sherwood
On the VPython list Scott Daniels suggested using try/except to deal with the problem of sqrt(5.5) being numpy.float64 and thereby making sqrt(5.5)*(VPython vector) not a (VPython vector), which ends up as a big performance hit on existing programs. I tried his suggestion and did some timing us

Re: [Numpy-discussion] [C++-sig] Overloading sqrt(5.5)*myvector

2007-12-28 Thread Bruce Sherwood
I realized belatedly that I should upgrade from Boost 1.33 to 1.34. Alas, that didn't cure my problem. Bruce Sherwood Bruce Sherwood wrote: > I should have added: This structure worked with the older version of > VPython which used Numeric, but it doesn't work in the beta version > which uses

Re: [Numpy-discussion] numpy installed but can' use

2007-12-28 Thread dikshie
On Dec 29, 2007 1:38 PM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > Yes, the key is what "names" are "imported" into the current namespace > (what names are visible to your code). > > import numpy > > loads the module and places the name "numpy" in the current namespace > which points to the

Re: [Numpy-discussion] numpy installed but can' use

2007-12-28 Thread Travis E. Oliphant
dikshie wrote: > On Dec 29, 2007 1:57 AM, Christopher Barker <[EMAIL PROTECTED]> wrote: > the names in the > >> numpy module into this namespace. There is no name: "numpy" in the numpy >> module -- it's the name of the module itself. Try: >> >> import numpy >> numpy.__version__ >> > > > so

Re: [Numpy-discussion] numpy installed but can' use

2007-12-28 Thread dikshie
On Dec 29, 2007 1:57 AM, Christopher Barker <[EMAIL PROTECTED]> wrote: the names in the > numpy module into this namespace. There is no name: "numpy" in the numpy > module -- it's the name of the module itself. Try: > > import numpy > numpy.__version__ so import numpy and from numpy import * are

Re: [Numpy-discussion] any better way to normalize a matrix

2007-12-28 Thread Anne Archibald
On 28/12/2007, Christopher Barker <[EMAIL PROTECTED]> wrote: > Anne Archibald wrote: > > Numpy provides ufuncs as general powerful tools for operating on > > matrices. More can be added relatively easily, they provide not just > > the basic "apply" operation but also "outer" and others. Adding > >

Re: [Numpy-discussion] any better way to normalize a matrix

2007-12-28 Thread Christopher Barker
Anne Archibald wrote: > Numpy provides ufuncs as general powerful tools for operating on > matrices. More can be added relatively easily, they provide not just > the basic "apply" operation but also "outer" and others. Adding > another way to accomplish the same operation just adds bulk to numpy.

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-28 Thread Stefan van der Walt
On Fri, Dec 28, 2007 at 11:32:03AM -0600, Travis E. Oliphant wrote: > I don't see the point in every file having a __docformat__ line, when > our documentaion formatting tool should already know the standard we are > using is. It's just more cruft. Besides the PEP was rejected, so I > don't

Re: [Numpy-discussion] any better way to normalize a matrix

2007-12-28 Thread Anne Archibald
On 28/12/2007, Christopher Barker <[EMAIL PROTECTED]> wrote: > I like the array methods a lot -- is there any particular reason there > is no ndarray.abs(), or has it just not been added? Here I have to disagree with you. Numpy provides ufuncs as general powerful tools for operating on matrices.

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-28 Thread Fernando Perez
On Dec 28, 2007 12:55 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > Matthieu Brucher wrote: > > Matthew B. will be working on converting SciPy tests to use nose per > > Fernando's email. If you are familiar with nose and want to help, > > please make sure to check with Matthew or Fernan

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-28 Thread Robert Kern
Matthieu Brucher wrote: > Matthew B. will be working on converting SciPy tests to use nose per > Fernando's email. If you are familiar with nose and want to help, > please make sure to check with Matthew or Fernando first. > > > I must have missed Fernando's email because I can't fin

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-28 Thread Travis E. Oliphant
Stefan van der Walt wrote: > On Thu, Dec 27, 2007 at 09:27:09PM -0800, Jarrod Millman wrote: > >> On Dec 27, 2007 7:42 PM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: >> >>> Doc-day will start tomorrow (in about 12 hours). It will be Friday for >>> much of America and be moving into Satu

Re: [Numpy-discussion] any better way to normalize a matrix

2007-12-28 Thread Christopher Barker
Anne had it right -- much of the point of numpy is to use nd-arrays as the powerful objects they are - not just containers. Below is a version of your code for comparison. Note to numpy devs: I like the array methods a lot -- is there any particular reason there is no ndarray.abs(), or has it

Re: [Numpy-discussion] numpy installed but can' use

2007-12-28 Thread Eric Firing
dikshie wrote: > Hi, > successfully installed numpy but i cant use it (numpy is not defined). > for example: > > > Python 2.5.1 (r251:54863, Nov 25 2007, 02:18:29) > [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7 > Type "help", "copyright", "credits" or "license" for more information. from nump

Re: [Numpy-discussion] numpy installed but can' use

2007-12-28 Thread Christopher Barker
dikshie wrote: from numpy import * numpy.__version__ > Traceback (most recent call last): > File "", line 1, in > NameError: name 'numpy' is not defined > > any hints ? yes, you did an "import *", which means "bring all the names in the numpy module into this namespace. There is no

[Numpy-discussion] numpy installed but can' use

2007-12-28 Thread dikshie
Hi, successfully installed numpy but i cant use it (numpy is not defined). for example: Python 2.5.1 (r251:54863, Nov 25 2007, 02:18:29) [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7 Type "help", "copyright", "credits" or "license" for more information. >>> from numpy import * >>> numpy.__version__

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-28 Thread Matthieu Brucher
> > Matthew B. will be working on converting SciPy tests to use nose per > Fernando's email. If you are familiar with nose and want to help, > please make sure to check with Matthew or Fernando first. > I must have missed Fernando's email because I can't find the references for nose :( What are i

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-28 Thread Stefan van der Walt
On Thu, Dec 27, 2007 at 09:27:09PM -0800, Jarrod Millman wrote: > On Dec 27, 2007 7:42 PM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > > Doc-day will start tomorrow (in about 12 hours). It will be Friday for > > much of America and be moving into Saturday for Europe and Asia. Join > > in on t

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-28 Thread Fernando Perez
Since I won't be able to participate tomorrow, here's a small contribution. I just added this to ipython: http://projects.scipy.org/ipython/ipython/browser/ipython/trunk/IPython/dtutils.py You can load it in your startup file or interactively via from IPython.dtutils import idoctest Type idoct