Re: [Numpy-discussion] Forcing gufunc to error with size zero input

2019-09-29 Thread Warren Weckesser
On 9/29/19, Warren Weckesser wrote: > On 9/28/19, Eric Wieser wrote: >> Can you just raise an exception in the gufuncs inner loop? Or is there no >> mechanism to do that today? > > Maybe? I don't know what is the idiomatic way to handle errors > detected in an inner loop. And pushing this

Re: [Numpy-discussion] Forcing gufunc to error with size zero input

2019-09-28 Thread Sebastian Berg
On Sun, 2019-09-29 at 00:20 -0400, Warren Weckesser wrote: > On 9/28/19, Eric Wieser wrote: > > Can you just raise an exception in the gufuncs inner loop? Or is > > there no > > mechanism to do that today? > > Maybe? I don't know what is the idiomatic way to handle errors > detected in an inner

Re: [Numpy-discussion] Forcing gufunc to error with size zero input

2019-09-28 Thread Warren Weckesser
On 9/29/19, Warren Weckesser wrote: > On 9/28/19, Eric Wieser wrote: >> Can you just raise an exception in the gufuncs inner loop? Or is there no >> mechanism to do that today? > > Maybe? I don't know what is the idiomatic way to handle errors > detected in an inner loop. And pushing this

Re: [Numpy-discussion] Forcing gufunc to error with size zero input

2019-09-28 Thread Warren Weckesser
On 9/28/19, Eric Wieser wrote: > Can you just raise an exception in the gufuncs inner loop? Or is there no > mechanism to do that today? Maybe? I don't know what is the idiomatic way to handle errors detected in an inner loop. And pushing this particular error detection into the inner loop

Re: [Numpy-discussion] Forcing gufunc to error with size zero input

2019-09-28 Thread Eric Wieser
Can you just raise an exception in the gufuncs inner loop? Or is there no mechanism to do that today? I don't think you were proposing that core dimensions should _never_ be allowed to be 0, but if you were I disagree. I spent a fair amount of work enabling that for linalg because it provided

[Numpy-discussion] Forcing gufunc to error with size zero input

2019-09-28 Thread Warren Weckesser
I'm experimenting with gufuncs, and I just created a simple one with signature '(i)->()'. Is there a way to configure the gufunc itself so that an empty array results in an error? Or would I have to create a Python wrapper around the gufunc that does the error checking? Currently, when passed an