- 
                Notifications
    You must be signed in to change notification settings 
- Fork 51
Open
Labels
enhancementNew feature or requestNew feature or request
Description
After #811 merged, any DimStack now behaves a lot like an AbstractArray that iterates NamedTuples. Should we declare it as such?
It could even be an AbstractBasicDimArray, but that would require some changes as a AbstractDimStack does not have its dimension in its type, currently.
It would allow us to remove a whole list of array-like methods, and make additional things work, e.g.:
A = [1.0 2.0 3.0; 4.0 5.0 6.0]
dimz = (X([:a, :b]), Y(10.0:10.0:30.0))
da1 = DimArray(A, dimz; name=:one)
da2 = DimArray(Float32.(2A), dimz; name=:two)
da3 = DimArray(Int.(3A), dimz; name=:three)
s = DimStack((da1, da2, da3))
broadcast!(s, s) do x
    (one = 1, two = 2, three = 3)
endThis now fails because ndims is not implemented for DimStack (an oversight, I assume), but if I just add
abstract type AbstractDimStack{K,T,N,L} <: AbstractArray{T,N} end
then it just works.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request