inaos / iron-array

2 stars 0 forks source link

Implement an param.coords for scalar UDFs #537

Open FrancescAlted opened 2 years ago

FrancescAlted commented 2 years ago

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:

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.