Forcing gufunc to error with size zero input
29 Sep
2019
29 Sep
'19
12:47 a.m.
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 empty array, the ufunc loop is called with the core dimension associated with i set to 0. It would be nice if the code didn't get that far, and the ufunc machinery "knew" that this gufunc didn't accept a core dimension that is 0. I'd like to automatically get an error, something like the error produced by `np.max([])`. Warren
1663
Age (days ago)
1663
Last active (days ago)
5 comments
3 participants
participants (3)
-
Eric Wieser
-
Sebastian Berg
-
Warren Weckesser