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),