[Numpy-discussion] New ufuncs

Charles R Harris charlesr.harris at gmail.com
Mon Nov 10 19:05:03 EST 2008


On Mon, Nov 10, 2008 at 1:17 PM, Travis E. Oliphant
<oliphant at enthought.com>wrote:

> Charles R Harris wrote:
> >
> >
> > On Sun, Nov 9, 2008 at 11:29 PM, T J <tjhnson at gmail.com
> > <mailto:tjhnson at gmail.com>> wrote:
> >
> >     On Thu, Nov 6, 2008 at 3:01 PM, T J <tjhnson at gmail.com
> >     <mailto:tjhnson at gmail.com>> wrote:
> >     > On Thu, Nov 6, 2008 at 2:36 PM, Charles R Harris
> >     > <charlesr.harris at gmail.com <mailto:charlesr.harris at gmail.com>>
> >     wrote:
> >     >> I could add exp2, log2, and logaddexp2 pretty easily. Almost
> >     too easily, I
> >     >> don't want to clutter up numpy with a lot of functions.
> >     However, if there is
> >     >> a community for these functions I will put them in.
> >     >>
> >     >
> >     > I worry about clutter as well.  Note that scipy provides log2
> >     and exp2
> >     > already (scipy.special).  So I think only logaddexp2 would be
> needed
> >     > and (eventually) logdotexp2.  Maybe scipy.special is a better place
> >     > than in numpy?  Then perhaps the clutter could be avoided....though
> >     > I'm probably not the best one to ask for advice on this.  I will
> >     > definitely use the functions and I suspect many others will as
> >     > well---where ever they are placed.
> >
> >     Since no one commented further on this, can we go ahead and add
> >     logaddexp2?  Once in svn, we can always deal with 'location'
> later---I
> >     just don't want it to get forgotten.
> >     __
> >
> >
> > The functions exp2 and log2 are part of the C99 standard, so I'll add
> > those two along with log21p,
> > exp21m, and logaddexp2. The names log21p and exp21p look a bit creepy
> > so I'm open to suggestions.
> I think the C99 standard is a good place to draw the line.
>
> We can put other ufuncs in scipy.special
>

I added log2 and exp2. I still need to do the complex versions. I think
logaddexp2 should go in also to compliment these. Note that MPL also defines
log2 and their version has slightly different properties, i.e., it returns
integer values for integer powers of two.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20081110/96c8e7f8/attachment.html>


More information about the NumPy-Discussion mailing list