Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-20 Thread Stephan Hoyer
On Thu, Mar 17, 2016 at 3:28 PM, Jaime Fernández del Río < jaime.f...@gmail.com> wrote: > Would the logic for such a thing be consistent? E.g. how do you decide if > the user is requesting (k),(k)->(), or (k),()->() with broadcasting over a > non-core dimension of size k in the second argument? Wh

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-20 Thread Jaime Fernández del Río
On Thu, Mar 17, 2016 at 10:41 PM, Stephan Hoyer wrote: > On Thu, Mar 17, 2016 at 1:04 AM, Travis Oliphant > wrote: > >> I think that is a good idea.Let the user decide if scalar >> broadcasting is acceptable for their function. >> >> Here is a simple concrete example where scalar broadcastin

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Steve Waterbury
On 03/16/2016 06:28 PM, Nathaniel Smith wrote: ... Sounds like a real deprecation cycle would have been better. IMHO for a library as venerable and widely-used as Numpy, a deprecation cycle is almost always better ... consider this a lesson learned. For reference: Mailing list discussion:

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Nathaniel Smith
On Wed, Mar 16, 2016 at 12:48 PM, Travis Oliphant wrote: > > > On Wed, Mar 16, 2016 at 12:55 PM, Nathaniel Smith wrote: > >> Hi Travis, >> >> On Mar 16, 2016 9:52 AM, "Travis Oliphant" wrote: >> > >> > Hi everyone, >> > >> > Can you help me understand why the stricter changes to generalized >>

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Fernando Perez
On Wed, Mar 16, 2016 at 3:45 PM, Steve Waterbury wrote: > On 03/16/2016 06:28 PM, Nathaniel Smith wrote: > >> ... Sounds like a real deprecation cycle would have been better. >> > > IMHO for a library as venerable and widely-used as Numpy, a > deprecation cycle is almost always better ... conside

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Feng Yu
Hi, Here is another example. To write pix2ang (and similar functions) to a ufunc, one may want to have implicit scalar broadcast on `nested` and `nsides` arguments. The function is described here: http://healpy.readthedocs.org/en/latest/generated/healpy.pixelfunc.pix2ang.html#healpy.pixelfunc.p

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Charles R Harris
On Wed, Mar 16, 2016 at 1:48 PM, Travis Oliphant wrote: > > > On Wed, Mar 16, 2016 at 12:55 PM, Nathaniel Smith wrote: > >> Hi Travis, >> >> On Mar 16, 2016 9:52 AM, "Travis Oliphant" wrote: >> > >> > Hi everyone, >> > >> > Can you help me understand why the stricter changes to generalized >> u

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Travis Oliphant
On Wed, Mar 16, 2016 at 3:07 PM, Charles R Harris wrote: > > > On Wed, Mar 16, 2016 at 1:48 PM, Travis Oliphant > wrote: > >> >> >> On Wed, Mar 16, 2016 at 12:55 PM, Nathaniel Smith wrote: >> >>> Hi Travis, >>> >>> On Mar 16, 2016 9:52 AM, "Travis Oliphant" wrote: >>> > >>> > Hi everyone, >>>

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Nathaniel Smith
On Thu, Mar 17, 2016 at 2:04 PM, Feng Yu wrote: > Hi, > > ang2pix is used in astronomy to pixelize coordinate in forms of > (theta, phi). healpy is a binding of healpix > (http://healpix.sourceforge.net/, introduction there too), plus a lot > of more extra features or bloat (and I am not particula

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Feng Yu
Hi, ang2pix is used in astronomy to pixelize coordinate in forms of (theta, phi). healpy is a binding of healpix (http://healpix.sourceforge.net/, introduction there too), plus a lot of more extra features or bloat (and I am not particular fond of this aspect of healpy). It gets the work done. Yo

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Steve Waterbury
On 03/16/2016 10:32 PM, Fernando Perez wrote: On Wed, Mar 16, 2016 at 3:45 PM, Steve Waterbury mailto:water...@pangalactic.us>> wrote: On 03/16/2016 06:28 PM, Nathaniel Smith wrote: ... Sounds like a real deprecation cycle would have been better. IMHO for a library as venerabl

[Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Travis Oliphant
Hi everyone, Can you help me understand why the stricter changes to generalized ufunc argument checking no now longer allows scalars to be interpreted as 1-d arrays in the core-dimensions? Is there a way to specify in the core-signature that scalars should be allowed and interpreted in those case

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Travis Oliphant
On Wed, Mar 16, 2016 at 12:55 PM, Nathaniel Smith wrote: > Hi Travis, > > On Mar 16, 2016 9:52 AM, "Travis Oliphant" wrote: > > > > Hi everyone, > > > > Can you help me understand why the stricter changes to generalized ufunc > argument checking no now longer allows scalars to be interpreted as

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread josef.pktd
On Thu, Mar 17, 2016 at 1:08 AM, Steve Waterbury wrote: > On 03/16/2016 10:32 PM, Fernando Perez wrote: > >> On Wed, Mar 16, 2016 at 3:45 PM, Steve Waterbury >> mailto:water...@pangalactic.us>> wrote: >> >> On 03/16/2016 06:28 PM, Nathaniel Smith wrote: >> >> ... Sounds like a real de

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Stephan Hoyer
On Thu, Mar 17, 2016 at 2:49 PM, Travis Oliphant wrote: > That's a great idea! > > Adding multiple-dispatch capability for this case could also solve a lot > of issues that right now prevent generalized ufuncs from being the > mechanism of implementation of *all* NumPy functions. > > -Travis > F

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-19 Thread Joseph Fox-Rabinovitz
On Thu, Mar 17, 2016 at 10:03 AM, Nathaniel Smith wrote: > On Mar 17, 2016 1:22 AM, "Feng Yu" wrote: >> >> Hi, >> >> Here is another example. >> >> To write pix2ang (and similar functions) to a ufunc, one may want to have >> implicit scalar broadcast on `nested` and `nsides` arguments. >> >> The

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-18 Thread Travis Oliphant
On Thu, Mar 17, 2016 at 4:41 PM, Stephan Hoyer wrote: > On Thu, Mar 17, 2016 at 1:04 AM, Travis Oliphant > wrote: > >> I think that is a good idea.Let the user decide if scalar >> broadcasting is acceptable for their function. >> >> Here is a simple concrete example where scalar broadcasting

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-18 Thread Feng Yu
Thanks for the explanation. I see the point now. On Thu, Mar 17, 2016 at 3:21 PM, Nathaniel Smith wrote: > On Thu, Mar 17, 2016 at 2:04 PM, Feng Yu wrote: >> Hi, >> >> ang2pix is used in astronomy to pixelize coordinate in forms of >> (theta, phi). healpy is a binding of healpix >> (http://healp

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-18 Thread Nathaniel Smith
On Mar 17, 2016 1:22 AM, "Feng Yu" wrote: > > Hi, > > Here is another example. > > To write pix2ang (and similar functions) to a ufunc, one may want to have implicit scalar broadcast on `nested` and `nsides` arguments. > > The function is described here: > > http://healpy.readthedocs.org/en/latest

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-18 Thread Nathaniel Smith
On Wed, Mar 16, 2016 at 7:32 PM, Fernando Perez wrote: > On Wed, Mar 16, 2016 at 3:45 PM, Steve Waterbury > wrote: >> >> On 03/16/2016 06:28 PM, Nathaniel Smith wrote: >>> >>> ... Sounds like a real deprecation cycle would have been better. >> >> >> IMHO for a library as venerable and widely-used

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-18 Thread Nathaniel Smith
Hi Travis, On Mar 16, 2016 9:52 AM, "Travis Oliphant" wrote: > > Hi everyone, > > Can you help me understand why the stricter changes to generalized ufunc argument checking no now longer allows scalars to be interpreted as 1-d arrays in the core-dimensions? > > Is there a way to specify in the co

Re: [Numpy-discussion] Changes to generalized ufunc core dimension checking

2016-03-18 Thread Stephan Hoyer
On Thu, Mar 17, 2016 at 1:04 AM, Travis Oliphant wrote: > I think that is a good idea.Let the user decide if scalar broadcasting > is acceptable for their function. > > Here is a simple concrete example where scalar broadcasting makes sense: > > A 1-d dot product (the core of np.inner) (k),