Re: [Numpy-discussion] 1.8 release

2013-01-14 Thread Nathaniel Smith
On Mon, Jan 14, 2013 at 4:45 PM, Frédéric Bastien wrote: > I don't volontear for the next release manager, but +1 for shorter > releases. I heard just good comments from that. Also, I'm not sure it > would ask more from the release manager. Do someone have an idea? The > most work I do as a releas

Re: [Numpy-discussion] 1.8 release

2013-01-14 Thread Ralf Gommers
On Mon, Jan 14, 2013 at 1:19 AM, David Cournapeau wrote: > On Sun, Jan 13, 2013 at 5:26 PM, Nathaniel Smith wrote: > > On Sun, Jan 13, 2013 at 7:03 PM, Charles R Harris > > wrote: > >> Now that 1.7 is nearing release, it's time to look forward to the 1.8 > >> release. I'd like us to get back to

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Alan G Isaac
Thanks Pierre for noting that np.tile already provides a chunk of this functionality: >>> a = np.tile(5,(1,2,3)) >>> a array([[[5, 5, 5], [5, 5, 5]]]) >>> np.tile(1,a.shape) array([[[1, 1, 1], [1, 1, 1]]]) I had not realized a scalar first argument was possible. Alan Isaac _

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Benjamin Root
On Mon, Jan 14, 2013 at 1:56 PM, David Warde-Farley < d.warde.far...@gmail.com> wrote: > On Mon, Jan 14, 2013 at 1:12 PM, Pierre Haessig > wrote: > > In [8]: tile(nan, (3,3)) # (it's a verb ! ) > > tile, in my opinion, is useful in some cases (for people who think in > terms of repmat()) but not

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread David Warde-Farley
On Mon, Jan 14, 2013 at 1:12 PM, Pierre Haessig wrote: > In [8]: tile(nan, (3,3)) # (it's a verb ! ) tile, in my opinion, is useful in some cases (for people who think in terms of repmat()) but not very NumPy-ish. What I'd like is a function that takes - an initial array_like "a" - a shape "s" -

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread David Warde-Farley
On Mon, Jan 14, 2013 at 9:57 AM, Benjamin Root wrote: > > > On Mon, Jan 14, 2013 at 7:38 AM, Pierre Haessig > wrote: >> >> Hi, >> >> Le 14/01/2013 00:39, Nathaniel Smith a écrit : >> > (The nice thing about np.filled() is that it makes np.zeros() and >> > np.ones() feel like clutter, rather than

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Pierre Haessig
Le 14/01/2013 18:33, Benjamin Root a écrit : > > > How about "initialized()"? > > > A verb! +1 from me! Shouldn't it be "initialize()" then ? I'm not so fond of it though, because initialize is pretty broad in the field of programming. What about "refurbishing" the already existing "tile()" fu

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Charles R Harris
On Sun, Jan 13, 2013 at 4:24 PM, Robert Kern wrote: > On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith wrote: > > Hi all, > > > > PR 2875 adds two new functions, that generalize zeros(), ones(), > > zeros_like(), ones_like(), by simply taking an arbitrary fill value: > > https://github.com/num

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Benjamin Root
On Mon, Jan 14, 2013 at 12:27 PM, Eric Firing wrote: > On 2013/01/14 6:15 AM, Olivier Delalleau wrote: > > - I agree the name collision with np.ma.filled is a problem. I have no > > better suggestion though at this point. > > How about "initialized()"? > A verb! +1 from me! For those wondering,

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Eric Firing
On 2013/01/14 6:15 AM, Olivier Delalleau wrote: > - I agree the name collision with np.ma.filled is a problem. I have no > better suggestion though at this point. How about "initialized()"? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org htt

Re: [Numpy-discussion] New numpy functions: vals and vals_like or filled, filled_like?

2013-01-14 Thread Alan G Isaac
Just changing the subject line so a good suggestion does not get lost ... Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread josef . pktd
On Mon, Jan 14, 2013 at 11:22 AM, wrote: > On Mon, Jan 14, 2013 at 11:15 AM, Olivier Delalleau wrote: >> 2013/1/14 Matthew Brett : >>> Hi, >>> >>> On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld >>> wrote: Robert Kern gmail.com> writes: > > >>> > > >>> > One alternative

Re: [Numpy-discussion] 1.8 release

2013-01-14 Thread Frédéric Bastien
Hi, I don't volontear for the next release manager, but +1 for shorter releases. I heard just good comments from that. Also, I'm not sure it would ask more from the release manager. Do someone have an idea? The most work I do as a release manager for theano is the preparation/tests/release notes a

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread josef . pktd
On Mon, Jan 14, 2013 at 11:15 AM, Olivier Delalleau wrote: > 2013/1/14 Matthew Brett : >> Hi, >> >> On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld >> wrote: >>> Robert Kern gmail.com> writes: >>> >>> > >>> > One alternative that does not expand the API with two-liners is to >>>

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Olivier Delalleau
2013/1/14 Matthew Brett : > Hi, > > On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld > wrote: >> Robert Kern gmail.com> writes: >> >>> >>> >>> > >>> >>> > One alternative that does not expand the API with two-liners is to let >>> >>> > the ndarray.fill() method return self: >>> >>> > >>> >>> >

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Matthew Brett
Hi, On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld wrote: > Robert Kern gmail.com> writes: > >> >> >>> > >> >>> > One alternative that does not expand the API with two-liners is to let >> >>> > the ndarray.fill() method return self: >> >>> > >> >>> > a = np.empty(...).fill(20.0) >> >>> >> >>

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Robert Kern
On Mon, Jan 14, 2013 at 4:12 PM, Frédéric Bastien wrote: > Why not optimize NumPy to detect a mul of an ndarray by a scalar to > call fill? That way, "np.empty * 2" will be as fast as "x=np.empty; > x.fill(2)"? In general, each element of an array will be different, so the result of the multiplic

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Robin
On Mon, Jan 14, 2013 at 2:57 PM, Benjamin Root wrote: > I am also +1 on the idea of having a filled() and filled_like() function (I > learned a long time ago to just do a = np.empty() and a.fill() rather than > the multiplication trick I learned from Matlab). However, the collision > with the mas

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Frédéric Bastien
Why not optimize NumPy to detect a mul of an ndarray by a scalar to call fill? That way, "np.empty * 2" will be as fast as "x=np.empty; x.fill(2)"? Fred On Mon, Jan 14, 2013 at 9:57 AM, Benjamin Root wrote: > > > On Mon, Jan 14, 2013 at 7:38 AM, Pierre Haessig > wrote: >> >> Hi, >> >> Le 14/01/

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Benjamin Root
On Mon, Jan 14, 2013 at 7:38 AM, Pierre Haessig wrote: > Hi, > > Le 14/01/2013 00:39, Nathaniel Smith a écrit : > > (The nice thing about np.filled() is that it makes np.zeros() and > > np.ones() feel like clutter, rather than the reverse... not that I'm > > suggesting ever getting rid of them, bu

Re: [Numpy-discussion] phase unwrapping (1d)

2013-01-14 Thread Neal Becker
This code should explain all: import numpy as np arg = np.angle def nint (x): return int (x + 0.5) if x >= 0 else int (x - 0.5) def unwrap (inp, y=np.pi, init=0, cnt=0): o = np.empty_like (inp) prev_o = init for i in range (len (inp)): o[i]

Re: [Numpy-discussion] Insights / lessons learned from NumPy design

2013-01-14 Thread Mike Anderson
Just wanted to say a big thanks to everyone in the NumPy community who has commented on this topic - it's given us a lot to think about and a lot of good ideas to work into the design! Best regards, Mike. On 4 January 2013 14:29, Mike Anderson wrote: > Hello all, > > In the Clojure communit

Re: [Numpy-discussion] phase unwrapping (1d)

2013-01-14 Thread Pierre Haessig
Hi Neal, Le 11/01/2013 16:40, Neal Becker a écrit : > I wanted to be able to handle the case of > > unwrap (arg (x1) + arg (x2)) > > Here, phase can change by more than 2pi. It's not clear to me what you mean by "change more than 2pi" ? Do you mean that the consecutive points of in input can incre

Re: [Numpy-discussion] phase unwrapping (1d)

2013-01-14 Thread Neal Becker
Nadav Horesh wrote: > There is an unwrap function in numpy. Doesn't it work for you? > Like I had said, np.unwrap was too slow. Profiling showed it eating up an absurd proportion of time. My c++ code was much better (although still surprisingly slow). ___

Re: [Numpy-discussion] numpydoc for python 3?

2013-01-14 Thread Matthew Brett
Hi, On Mon, Jan 14, 2013 at 10:35 AM, Jaakko Luttinen wrote: > On 01/14/2013 12:53 AM, Matthew Brett wrote: >> On Sun, Jan 13, 2013 at 10:46 PM, Jaakko Luttinen >> wrote: >>> I'm a bit stuck trying to make numpydoc Python 3 compatible. I made >>> setup.py try to use distutils.command.build_py.bu

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Pierre Haessig
Hi, Le 14/01/2013 00:39, Nathaniel Smith a écrit : > (The nice thing about np.filled() is that it makes np.zeros() and > np.ones() feel like clutter, rather than the reverse... not that I'm > suggesting ever getting rid of them, but it makes the API conceptually > feel smaller, not larger.) Coming

Re: [Numpy-discussion] 1.8 release

2013-01-14 Thread Matthew Brett
Hi, On Mon, Jan 14, 2013 at 12:19 AM, David Cournapeau wrote: > On Sun, Jan 13, 2013 at 5:26 PM, Nathaniel Smith wrote: >> On Sun, Jan 13, 2013 at 7:03 PM, Charles R Harris >> wrote: >>> Now that 1.7 is nearing release, it's time to look forward to the 1.8 >>> release. I'd like us to get back t

Re: [Numpy-discussion] 1.8 release

2013-01-14 Thread Phil Elson
I tried to suggest this for our matplotlib development cycle, but it didn't get the roaring response I was hoping for (even though I was being conservative by suggesting a 8-9 month release time): http://matplotlib.1069221.n5.nabble.com/strategy-for-1-2-x-master-PEP8-changes-tp39453p39465.html In

Re: [Numpy-discussion] numpydoc for python 3?

2013-01-14 Thread Pierre Haessig
Hi, Le 14/01/2013 11:35, Jaakko Luttinen a écrit : > Ok, thanks, maybe I'll try to make the tests valid in all Python > versions. It seems there's only one line which I'm not able to transform. > > In doc/sphinxext/tests/test_docscrape.py, on line 559: > assert doc['Summary'][0] == u'öäöäöäöäö

Re: [Numpy-discussion] numpydoc for python 3?

2013-01-14 Thread Jaakko Luttinen
On 01/14/2013 12:53 AM, Matthew Brett wrote: > On Sun, Jan 13, 2013 at 10:46 PM, Jaakko Luttinen > wrote: >> I'm a bit stuck trying to make numpydoc Python 3 compatible. I made >> setup.py try to use distutils.command.build_py.build_py_2to3 in order to >> transform installed code automatically to

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Dave Hirschfeld
Robert Kern gmail.com> writes: > > >>> > > >>> > One alternative that does not expand the API with two-liners is to let > >>> > the ndarray.fill() method return self: > >>> > > >>> > a = np.empty(...).fill(20.0) > >>> > >>> This violates the convention that in-place operations never return > >