ufunc should warn when argument `where` is specified and `out` is default None.

My argument is that `where` makes sense unless `out` is default `None`, in which case it simply obscures the creation of a partially uninitialised array. The casual numpy user accessing through the public API likely only wants garbage values if they have explicitly asked for them using `empty_like`. If they have decided not to pass `out`, it probably means they expect a partially transformed copy of the input array and have overlooked the note in the docstring. Example: User creates a function that log transforms values where log is defined . ``` def safe_log(val, out): return np.log(val, where=np.greater(val, 0), out=out) ``` User suddenly decides that they don't want to specify `out` every time, making `safe_log` unsafe. ``` def safe_log(val, out=None): return np.log(val, where=np.greater(val, 0), out=out) ```
participants (1)
-
p.j.lenihan1@leeds.ac.uk