You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the PyHEP.dev workshop, it was observed that the axis parameter has the potential to harm readability of an analysis. This follows from the idea that the semantic interpretation of the axis parameter requires knowledge of the array structure, which is normally a strong function of the execution history.
We should be able to label / name axes for readability.
Awkward Array can/should add support for named axes, c.f. XArray with dimension names
No need to add labels because they're much more specific to plotting
New function e.g. array = ak.with_axis_name(array, 0, "events") to permit ak.sum(array, axis="events")
The flatten(array[argmax(..., keepdims=True)]) pattern is complex to understand, despite being a pattern
We could add an accessor that allows us to force ragged indexing. This permits to have a single-index accessor if needs be, that directly consumes the result of argmax(..., keepdims=False), e.g. array.at[...]. We could also have a similar-yet-different array.select[...] that accepts a keepdims=True positional reducer result, and flattens the result afterwards (we know that keepdims=True produces regular dimensions, which can be identified statically).
My current thinking on this, following from the workshop discussion, is that we should add a mechanism for labelling axes with a name, such that this name can later be used in place of the integer value.
Description of new feature
At the PyHEP.dev workshop, it was observed that the axis parameter has the potential to harm readability of an analysis. This follows from the idea that the semantic interpretation of the
axis
parameter requires knowledge of the array structure, which is normally a strong function of the execution history.The notes from the workshop are below:
My current thinking on this, following from the workshop discussion, is that we should add a mechanism for labelling axes with a name, such that this name can later be used in place of the integer value.
The text was updated successfully, but these errors were encountered: