The same way that regular (vector) UDFs assign attributes like window_shape, it would be nice if scalar UDFs support a similar thing but adapted to the scalar nature of the params.
I suggest to add at least these:
param.ndim : number of dimensions of the array.
param.shape : the shape of the array.
param.coords: the (absolute) coordinates of the element that is being computed.
It is true that it can be a bit silly to provide this info for all the parameters (all would provide essentially the same info). It would be great if an internal variable could be used instead (e.g. __pos__.ndim or __pos__.coords or similar).
That would allow to perform operations depending on which position the UDF has been called. My guess is that this can be useful in many situations. But if implementation would be complex, or performance would be seriously affected, better refrain from doing this.
The same way that regular (vector) UDFs assign attributes like
window_shape
, it would be nice if scalar UDFs support a similar thing but adapted to the scalar nature of the params.I suggest to add at least these:
param.ndim
: number of dimensions of the array.param.shape
: the shape of the array.param.coords
: the (absolute) coordinates of the element that is being computed.It is true that it can be a bit silly to provide this info for all the parameters (all would provide essentially the same info). It would be great if an internal variable could be used instead (e.g.
__pos__.ndim
or__pos__.coords
or similar).That would allow to perform operations depending on which position the UDF has been called. My guess is that this can be useful in many situations. But if implementation would be complex, or performance would be seriously affected, better refrain from doing this.