Using a named tuple of arrays to represent the dimension structure and item names,
and have the system take the length of each dimension from the length of each array.
Similarly I can specify x[:A, :, :]
But it would by nice to write it as x.Dim1.A
There are definately some packages with nicer syntax for this - like DimensionalData.jl and AxisKeys.jl. But I don’t think they the getproperty “.” syntax! (?) It’s not very array-like, and it forces you to know the order of the indices.
In DimensionalData.jl you would just write
x = DimArray(zeros(2,3,4), (dim1=[:A, :B], dim2=[:X, :Y, :Z], dimnum=1:4))
x[dim1=:A]