DimensionalData.jl
DimensionalData.jl copied to clipboard
`selectdim` for DimStack
da = rand(X(1:10), Y(1:10))
ds = DimStack((a = da, b = da))
ds[1:3,:] # working
@view ds[1:3,:] # working
selectdim(ds,1,1:3) # not working
Maybe it would be nice to make selectdim work?
I guess it should also work with dimensions for Dim, and selectors as the last argument.
But also, what do you use this for? isn't it more concise to do ds[X=1:3] ?
Yes, ds[X=1:3] is more concise and better if we know ds isa DimStack.
My use case is that I have generic code do selectdim on array-like objects. Since DimStack is kinda of like an array, having selectdim work would simplify the logic and codes.
Makes total sense. Try a PR if you are up for it, I am very short on time currently.