rafaqz / DimensionalData.jl

Named dimensions and indexing for julia arrays and other data
https://rafaqz.github.io/DimensionalData.jl/stable/
MIT License
281 stars 42 forks source link

A 0-dimensional view of a `DimArray` has non-zero dimensions #438

Closed sethaxen closed 1 year ago

sethaxen commented 1 year ago
julia> using DimensionalData

julia> da = DimArray(randn(10, 4, 2), (:draw, :chain, :var));

julia> view(da, 1)
0-dimensional DimArray{Float64,0} with dimensions: Dim{:chain}, Dim{:var}
and reference dimensions: Dim{:draw}

1.26981

I would expect :chain and :var to also be reference dimensions.

rafaqz commented 1 year ago

Ok something is broken in reducedims slicedims I guess, we need to generated all the trailing 1s