Re: [matplotlib-devel] mpl.math namespace

2007-07-21 Thread Jouni K . Seppänen
Eric Firing <[EMAIL PROTECTED]> writes: > 1) Present: always be explicit: npy.sin or ma.sin or math.sin or > cmath.sin. [...] > > 2) Pick a set of math symbols that may be imported directly from numpy > at the top, and either import all routinely, or import as needed. There's also an option t

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Paul Kienzle
On Sat, Jul 21, 2007 at 08:51:19AM -1000, Eric Firing wrote: > John Hunter wrote: > [...] > > functions or array functions here, eg math.sqrt vs numpy.sqrt? Also, > > a few of your symbols clash with python builtins (min, max, abs) which > > is best avoided. Finally, how would you feel about allo

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Christopher Barker
John Hunter wrote: > We should prefer the numpyisms anyway, a.max(), a.min(), a.absolute(). Exactly -- OO semantics make the whole namespace thing much more workable. To sum up a bit -- This all started with a comment about how some of the pylab names clash with numpy names, so that: from pylab

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Fernando Perez
On 7/21/07, Eric Firing <[EMAIL PROTECTED]> wrote: > Sometimes functions from the different sources do the same thing, but > usually at different speeds. And the difference may be *very* significant: In [1]: import numpy as N In [2]: import math as M In [3]: nsqrt = N.sqrt In [4]: msqrt = M.s

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread John Hunter
On 7/21/07, Paul Kienzle <[EMAIL PROTECTED]> wrote: > True > >>> min(a) > 1 > >>> min(b) We should prefer the numpyisms anyway, a.max(), a.min(), a.absolute(). > > Finally, how would you feel about allowing these > > symbols in the module namespace, but w/o the import * semantics, eg, > > fo

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Eric Firing
John Hunter wrote: [...] > functions or array functions here, eg math.sqrt vs numpy.sqrt? Also, > a few of your symbols clash with python builtins (min, max, abs) which > is best avoided. Finally, how would you feel about allowing these > symbols in the module namespace, but w/o the import * sema

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Gael Varoquaux
On Sat, Jul 21, 2007 at 11:34:07AM -0400, Paul Kienzle wrote: > Feel free to tune the list appropriately. Particularly since max/min/abs > already do the right things with vectors: Hell, not with anything that more than 1D ! Beware. Gaël -

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Paul Kienzle
On Sat, Jul 21, 2007 at 09:42:16AM -0500, John Hunter wrote: > On 7/21/07, Paul Kienzle <[EMAIL PROTECTED]> wrote: > > I used the following list: > > > > symlist=`cat < > pi inf Inf nan NaN > > isfinite isnormal isnan isinf > > arccos arcsin arctan arctan2 cos sin tan > > arccosh arcsinh ar

Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread John Hunter
On 7/21/07, Paul Kienzle <[EMAIL PROTECTED]> wrote: > I used the following list: > > symlist=`cat < pi inf Inf nan NaN > isfinite isnormal isnan isinf > arccos arcsin arctan arctan2 cos sin tan > arccosh arcsinh arctanh cosh sinh tanh > exp log log10 expm1 log1p exp2 log2 > pow sqrt cbr

[matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Paul Kienzle
On Fri, Jul 20, 2007 at 05:05:40PM -0700, Christopher Barker wrote: > >> so I think it does make sense to bring the common names that show up in > >> math expressions into the main namespace. > > >> This is probably best just done by each individual according to his/her > >> taste. > > > > That