diff --git a/src/DimensionalData.jl b/src/DimensionalData.jl index 1600a41f6..c7cda2628 100644 --- a/src/DimensionalData.jl +++ b/src/DimensionalData.jl @@ -55,7 +55,7 @@ export AbstractDimArray, DimArray export AbstractDimStack, DimStack -export AbstractDimTable, DimTable +export AbstractDimTable, DimTable, WideDimTable export DimIndices, DimKeys, DimPoints diff --git a/src/tables.jl b/src/tables.jl index c18a85fb3..f788341ec 100644 --- a/src/tables.jl +++ b/src/tables.jl @@ -302,7 +302,7 @@ function WideDimTable(xs::Vararg{AbstractDimArray}; layernames=[Symbol("layer_$i end function WideDimTable(x::AbstractDimArray; layersfrom=nothing, mergedims=false) - if (layersfrom <: Dimension) && (any(isa.(dims(x), layersfrom))) + if !isnothing(layersfrom) && (layersfrom <: Dimension) && (any(isa.(dims(x), layersfrom))) nlayers = size(x, layersfrom) layers = [(@view x[layersfrom(i)]) for i in 1:nlayers] layernames = Symbol.(["$(dim2key(layersfrom))_$i" for i in 1:nlayers]) @@ -375,13 +375,6 @@ end else return dimarraycolumns(t)[i - 1] end - n_dimcols = length(dimcolumns(t)) - i = findfirst(==(key), keys) - if i <= n_dimcols - return dimcolumns(t)[i] - else - return dimarraycolumns(t)[i - n_dimcols] - end end @inline function Tables.getcolumn(t::WideDimTable, ::Type{T}, i::Int, key::Symbol) where T