Tullio & AxisKeys can dummy variables refer to named keys

Lincoln_Hannah
Thu, 15 Feb 2024 04:31:57 +0000
General Usage

Is there a more succinct way to do this?

ka = KeyedArray( ones(2,2), I=[:a,:b], J=[:x,:y] )

@tullio x[i,j] := ( ka[i,j], axiskeys(ka)[1][i], axiskeys(ka)[2][j])

Something like

@tullio x[i,j] := ( ka(i,j), i, j )

That is, can the dummy variables i,j refer to the named keys rather that numbered indices.

1 post - 1 participant