diff --git a/src/Dimensions/dimension.jl b/src/Dimensions/dimension.jl index d048ae373..38d07a631 100644 --- a/src/Dimensions/dimension.jl +++ b/src/Dimensions/dimension.jl @@ -32,8 +32,7 @@ A = DimArray(zeros(3, 5, 12), (y, x, ti)) # output -╭─────────────────────────────╮ -│ 3×5×12 DimArray{Float64, 3} │ +┌ 3×5×12 DimArray{Float64, 3} ┐ ├─────────────────────────────┴────────────────────────────────────────── dims ┐ ↓ Y Categorical{Char} ['a', 'b', 'c'] ForwardOrdered, → X Sampled{Int64} 2:2:10 ForwardOrdered Regular Points, @@ -54,8 +53,7 @@ x = A[X(2), Y(3)] # output -╭─────────────────────────────────╮ -│ 12-element DimArray{Float64, 1} │ +┌ 12-element DimArray{Float64, 1} ┐ ├─────────────────────────────────┴────────────────────────────────────── dims ┐ ↓ Ti Sampled{DateTime} DateTime("2021-01-01T00:00:00"):Month(1):DateTime("2021-12-01T00:00:00") ForwardOrdered Regular Points └──────────────────────────────────────────────────────────────────────────────┘ @@ -80,8 +78,7 @@ x = A[X(Between(3, 4)), Y(At('b'))] # output -╭───────────────────────────╮ -│ 1×12 DimArray{Float64, 2} │ +┌ 1×12 DimArray{Float64, 2} ┐ ├───────────────────────────┴──────────────────────────────────────────── dims ┐ ↓ X Sampled{Int64} 4:2:4 ForwardOrdered Regular Points, → Ti Sampled{DateTime} DateTime("2021-01-01T00:00:00"):Month(1):DateTime("2021-12-01T00:00:00") ForwardOrdered Regular Points diff --git a/src/Dimensions/primitives.jl b/src/Dimensions/primitives.jl index 32159ecdf..cf15dfc2e 100644 --- a/src/Dimensions/primitives.jl +++ b/src/Dimensions/primitives.jl @@ -131,8 +131,7 @@ any combination of either. julia> using DimensionalData julia> A = DimArray(ones(2, 3, 2), (X, Y, Z)) -╭────────────────────────────╮ -│ 2×3×2 DimArray{Float64, 3} │ +┌ 2×3×2 DimArray{Float64, 3} ┐ ├────────────────────── dims ┤ ↓ X, → Y, ↗ Z └────────────────────────────┘ @@ -364,8 +363,7 @@ A = ones(X(2), Y(4), Z(2)) Dimensions.swapdims(A, (Dim{:a}, Dim{:b}, Dim{:c})) # output -╭────────────────────────────╮ -│ 2×4×2 DimArray{Float64, 3} │ +┌ 2×4×2 DimArray{Float64, 3} ┐ ├────────────────────── dims ┤ ↓ a, → b, ↗ c └────────────────────────────┘ diff --git a/src/Lookups/lookup_arrays.jl b/src/Lookups/lookup_arrays.jl index 4d8210a50..9f69dc1cb 100644 --- a/src/Lookups/lookup_arrays.jl +++ b/src/Lookups/lookup_arrays.jl @@ -293,8 +293,7 @@ y = Y(Sampled([1, 4, 7, 10]; span=Regular(3), sampling=Intervals(Start()))) A = ones(x, y) # output -╭──────────────────────────╮ -│ 5×4 DimArray{Float64, 2} │ +┌ 5×4 DimArray{Float64, 2} ┐ ├──────────────────────────┴───────────────────────────────────────── dims ┐ ↓ X Sampled{Int64} 100:-20:20 ReverseOrdered Regular Intervals{Start}, → Y Sampled{Int64} [1, 4, 7, 10] ForwardOrdered Regular Intervals{Start} diff --git a/src/Lookups/selector.jl b/src/Lookups/selector.jl index e421c64a1..35e5fe1e8 100644 --- a/src/Lookups/selector.jl +++ b/src/Lookups/selector.jl @@ -551,8 +551,7 @@ A[X(Between(15, 25)), Y(Between(4, 6.5))] # output -╭────────────────────────╮ -│ 1×2 DimArray{Int64, 2} │ +┌ 1×2 DimArray{Int64, 2} ┐ ├────────────────────────┴───────────────────────────── dims ┐ ↓ X Sampled{Int64} 20:10:20 ForwardOrdered Regular Points, → Y Sampled{Int64} 5:6 ForwardOrdered Regular Points @@ -807,8 +806,7 @@ A = DimArray([1 2 3; 4 5 6], (X(10:10:20), Y(5:7))) A[X(Touches(15, 25)), Y(Touches(4, 6.5))] # output -╭────────────────────────╮ -│ 1×2 DimArray{Int64, 2} │ +┌ 1×2 DimArray{Int64, 2} ┐ ├────────────────────────┴───────────────────────────── dims ┐ ↓ X Sampled{Int64} 20:10:20 ForwardOrdered Regular Points, → Y Sampled{Int64} 5:6 ForwardOrdered Regular Points @@ -975,8 +973,7 @@ A[X(Where(x -> x > 15)), Y(Where(x -> x in (19, 21)))] # output -╭────────────────────────╮ -│ 1×2 DimArray{Int64, 2} │ +┌ 1×2 DimArray{Int64, 2} ┐ ├────────────────────────┴────────────────────────────── dims ┐ ↓ X Sampled{Int64} [20] ForwardOrdered Irregular Points, → Y Sampled{Int64} [19, 21] ForwardOrdered Irregular Points @@ -1017,8 +1014,7 @@ A[X=All(At(10.0), At(50.0)), Ti=All(1u"s"..10u"s", 90u"s"..100u"s")] # output -╭────────────────────────╮ -│ 2×4 DimArray{Int64, 2} │ +┌ 2×4 DimArray{Int64, 2} ┐ ├────────────────────────┴─────────────────────────────────────────────── dims ┐ ↓ X Sampled{Float64} [10.0, 50.0] ForwardOrdered Irregular Points, → Ti Sampled{Unitful.Quantity{Int64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}} [1 s, 6 s, 91 s, 96 s] ForwardOrdered Irregular Points diff --git a/src/array/array.jl b/src/array/array.jl index b4cc08a60..d3e054c28 100644 --- a/src/array/array.jl +++ b/src/array/array.jl @@ -401,8 +401,7 @@ julia> x = X(10:10:100); julia> A = DimArray(rand(12,10), (ti, x), name="example"); julia> A[X(Near([12, 35])), Ti(At(DateTime(2001,5)))] -╭────────────────────────────────────────╮ -│ 2-element DimArray{Float64, 1} example │ +┌ 2-element DimArray{Float64, 1} example ┐ ├────────────────────────────────────────┴────────────── dims ┐ ↓ X Sampled{Int64} [10, 40] ForwardOrdered Irregular Points └─────────────────────────────────────────────────────────────┘ @@ -410,8 +409,7 @@ julia> A[X(Near([12, 35])), Ti(At(DateTime(2001,5)))] 40 0.637077 julia> A[Near(DateTime(2001, 5, 4)), Between(20, 50)] -╭────────────────────────────────────────╮ -│ 4-element DimArray{Float64, 1} example │ +┌ 4-element DimArray{Float64, 1} example ┐ ├────────────────────────────────────────┴──────────── dims ┐ ↓ X Sampled{Int64} 20:10:50 ForwardOrdered Regular Points └───────────────────────────────────────────────────────────┘ @@ -425,8 +423,7 @@ Generator expression: ```jldoctest dimarray julia> DimArray((x, y) for x in X(1:3), y in Y(1:2); name = :Value) -╭────────────────────────────────────────────╮ -│ 3×2 DimArray{Tuple{Int64, Int64}, 2} Value │ +┌ 3×2 DimArray{Tuple{Int64, Int64}, 2} Value ┐ ├────────────────────────────────────────────┴──── dims ┐ ↓ X Sampled{Int64} 1:3 ForwardOrdered Regular Points, → Y Sampled{Int64} 1:2 ForwardOrdered Regular Points @@ -545,8 +542,7 @@ Keywords are the same as for [`DimArray`](@ref). julia> using DimensionalData, Random; Random.seed!(123); julia> fill(true, X(2), Y(4)) -╭───────────────────────╮ -│ 2×4 DimArray{Bool, 2} │ +┌ 2×4 DimArray{Bool, 2} ┐ ├───────────────── dims ┤ ↓ X, → Y └───────────────────────┘ @@ -578,8 +574,7 @@ Keywords are the same as for [`DimArray`](@ref). julia> using DimensionalData julia> rand(Bool, X(2), Y(4)) -╭───────────────────────╮ -│ 2×4 DimArray{Bool, 2} │ +┌ 2×4 DimArray{Bool, 2} ┐ ├───────────────── dims ┤ ↓ X, → Y └───────────────────────┘ @@ -587,8 +582,7 @@ julia> rand(Bool, X(2), Y(4)) 1 0 0 1 julia> rand(X([:a, :b, :c]), Y(100.0:50:200.0)) -╭──────────────────────────╮ -│ 3×3 DimArray{Float64, 2} │ +┌ 3×3 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────── dims ┐ ↓ X Categorical{Symbol} [:a, :b, :c] ForwardOrdered, → Y Sampled{Float64} 100.0:50.0:200.0 ForwardOrdered Regular Points @@ -621,8 +615,7 @@ Keywords are the same as for [`DimArray`](@ref). julia> using DimensionalData julia> zeros(Bool, X(2), Y(4)) -╭───────────────────────╮ -│ 2×4 DimArray{Bool, 2} │ +┌ 2×4 DimArray{Bool, 2} ┐ ├───────────────── dims ┤ ↓ X, → Y └───────────────────────┘ @@ -630,8 +623,7 @@ julia> zeros(Bool, X(2), Y(4)) 0 0 0 0 julia> zeros(X([:a, :b, :c]), Y(100.0:50:200.0)) -╭──────────────────────────╮ -│ 3×3 DimArray{Float64, 2} │ +┌ 3×3 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────── dims ┐ ↓ X Categorical{Symbol} [:a, :b, :c] ForwardOrdered, → Y Sampled{Float64} 100.0:50.0:200.0 ForwardOrdered Regular Points @@ -665,8 +657,7 @@ Keywords are the same as for [`DimArray`](@ref). julia> using DimensionalData julia> ones(Bool, X(2), Y(4)) -╭───────────────────────╮ -│ 2×4 DimArray{Bool, 2} │ +┌ 2×4 DimArray{Bool, 2} ┐ ├───────────────── dims ┤ ↓ X, → Y └───────────────────────┘ @@ -674,8 +665,7 @@ julia> ones(Bool, X(2), Y(4)) 1 1 1 1 julia> ones(X([:a, :b, :c]), Y(100.0:50:200.0)) -╭──────────────────────────╮ -│ 3×3 DimArray{Float64, 2} │ +┌ 3×3 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────── dims ┐ ↓ X Categorical{Symbol} [:a, :b, :c] ForwardOrdered, → Y Sampled{Float64} 100.0:50.0:200.0 ForwardOrdered Regular Points diff --git a/src/array/show.jl b/src/array/show.jl index b5f099543..b6a561ce5 100644 --- a/src/array/show.jl +++ b/src/array/show.jl @@ -99,11 +99,9 @@ print_type(io, x) = print(io, string(nameof(typeof(x)))) function print_top(io, mime, A) _, displaywidth = displaysize(io) blockwidth = min(displaywidth - 2, textwidth(sprint(summary, A)) + 2) - printstyled(io, '╭', '─'^blockwidth, '╮'; color=:light_black) - println(io) - printstyled(io, "│ "; color=:light_black) + printstyled(io, "┌ "; color=:light_black) summary(io, A) - printstyled(io, " │"; color=:light_black) + printstyled(io, " ┐"; color=:light_black) println(io) n, blockwidth = print_dims_block(io, mime, dims(A); displaywidth, blockwidth) lines = 2 + n diff --git a/src/dimindices.jl b/src/dimindices.jl index 0a80344d6..56ecd1996 100644 --- a/src/dimindices.jl +++ b/src/dimindices.jl @@ -76,8 +76,7 @@ are not in the same order. Or even if they are not all contained in each. ```jldoctest; setup = :(using DimensionalData, Random; Random.seed!(123)) julia> A = rand(Y(0.0:0.3:1.0), X('a':'f')) -╭──────────────────────────╮ -│ 4×6 DimArray{Float64, 2} │ +┌ 4×6 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────── dims ┐ ↓ Y Sampled{Float64} 0.0:0.3:0.9 ForwardOrdered Regular Points, → X Categorical{Char} 'a':1:'f' ForwardOrdered @@ -89,8 +88,7 @@ julia> A = rand(Y(0.0:0.3:1.0), X('a':'f')) 0.9 0.512083 0.867547 0.136551 0.959434 0.150155 0.941133 julia> di = DimIndices((X(1:2:4), Y(1:2:4))) -╭──────────────────────────────────────────────╮ -│ 2×2 DimIndices{Tuple{X{Int64}, Y{Int64}}, 2} │ +┌ 2×2 DimIndices{Tuple{X{Int64}, Y{Int64}}, 2} ┐ ├──────────────────────────────────────── dims ┤ ↓ X 1:2:3, → Y 1:2:3 @@ -100,8 +98,7 @@ julia> di = DimIndices((X(1:2:4), Y(1:2:4))) 3 (↓ X 3, → Y 1) (↓ X 3, → Y 3) julia> A[di] # Index A with these indices -╭──────────────────────────╮ -│ 2×2 DimArray{Float64, 2} │ +┌ 2×2 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────── dims ┐ ↓ Y Sampled{Float64} 0.0:0.6:0.6 ForwardOrdered Regular Points, → X Categorical{Char} 'a':2:'c' ForwardOrdered @@ -228,8 +225,7 @@ julia> A = rand(X(1.0:3.0:30.0), Y(1.0:5.0:30.0), Ti(1:2)); julia> target = rand(X(1.0:10.0:30.0), Y(1.0:10.0:30.0)); julia> A[DimSelectors(target; selectors=Near), Ti=2] -╭──────────────────────────╮ -│ 3×3 DimArray{Float64, 2} │ +┌ 3×3 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────────── dims ┐ ↓ X Sampled{Float64} [1.0, 10.0, 22.0] ForwardOrdered Irregular Points, → Y Sampled{Float64} [1.0, 11.0, 21.0] ForwardOrdered Irregular Points diff --git a/src/groupby.jl b/src/groupby.jl index 6792f6d32..70f7add8b 100644 --- a/src/groupby.jl +++ b/src/groupby.jl @@ -253,8 +253,7 @@ julia> using DimensionalData, Dates julia> A = rand(X(1:0.1:20), Y(1:20), Ti(DateTime(2000):Day(3):DateTime(2003))); julia> groups = groupby(A, Ti => month) # Group by month -╭───────────────────────────────────────────────────╮ -│ 12-element DimGroupByArray{DimArray{Float64,2},1} │ +┌ 12-element DimGroupByArray{DimArray{Float64,2},1} ┐ ├───────────────────────────────────────────────────┴───────────── dims ┐ ↓ Ti Sampled{Int64} [1, 2, …, 11, 12] ForwardOrdered Irregular Points ├───────────────────────────────────────────────────────────── metadata ┤ @@ -275,8 +274,7 @@ And take the mean: ```jldoctest groupby; setup = :(using Statistics) julia> groupmeans = mean.(groups) # Take the monthly mean -╭─────────────────────────────────╮ -│ 12-element DimArray{Float64, 1} │ +┌ 12-element DimArray{Float64, 1} ┐ ├─────────────────────────────────┴─────────────────────────────── dims ┐ ↓ Ti Sampled{Int64} [1, 2, …, 11, 12] ForwardOrdered Irregular Points ├───────────────────────────────────────────────────────────── metadata ┤ @@ -305,8 +303,7 @@ Or do something else with Y: ```jldoctest groupby julia> groupmeans = mean.(groupby(A, Ti=>month, Y=>isodd)) -╭───────────────────────────╮ -│ 12×2 DimArray{Float64, 2} │ +┌ 12×2 DimArray{Float64, 2} ┐ ├───────────────────────────┴────────────────────────────────────── dims ┐ ↓ Ti Sampled{Int64} [1, 2, …, 11, 12] ForwardOrdered Irregular Points, → Y Sampled{Bool} [false, true] ForwardOrdered Irregular Points diff --git a/src/set.jl b/src/set.jl index 1c7a2a112..dac869a29 100644 --- a/src/set.jl +++ b/src/set.jl @@ -41,8 +41,7 @@ julia> using DimensionalData; const DD = DimensionalData; julia> da = DimArray(zeros(3, 4), (custom=10.0:010.0:30.0, Z=-20:010.0:10.0)); julia> set(da, ones(3, 4)) -╭──────────────────────────╮ -│ 3×4 DimArray{Float64, 2} │ +┌ 3×4 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────────── dims ┐ ↓ custom Sampled{Float64} 10.0:10.0:30.0 ForwardOrdered Regular Points, → Z Sampled{Float64} -20.0:10.0:10.0 ForwardOrdered Regular Points @@ -57,8 +56,7 @@ Change the `Dimension` wrapper type: ```jldoctest set julia> set(da, :Z => Ti, :custom => Z) -╭──────────────────────────╮ -│ 3×4 DimArray{Float64, 2} │ +┌ 3×4 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────── dims ┐ ↓ Z Sampled{Float64} 10.0:10.0:30.0 ForwardOrdered Regular Points, → Ti Sampled{Float64} -20.0:10.0:10.0 ForwardOrdered Regular Points @@ -73,8 +71,7 @@ Change the lookup `Vector`: ```jldoctest set julia> set(da, Z => [:a, :b, :c, :d], :custom => [4, 5, 6]) -╭──────────────────────────╮ -│ 3×4 DimArray{Float64, 2} │ +┌ 3×4 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────────── dims ┐ ↓ custom Sampled{Int64} [4, 5, 6] ForwardOrdered Regular Points, → Z Sampled{Symbol} [:a, :b, :c, :d] ForwardOrdered Regular Points @@ -89,8 +86,7 @@ Change the `Lookup` type: ```jldoctest set julia> set(da, Z=DD.NoLookup(), custom=DD.Sampled()) -╭──────────────────────────╮ -│ 3×4 DimArray{Float64, 2} │ +┌ 3×4 DimArray{Float64, 2} ┐ ├──────────────────────────┴──────────────────────────────────────── dims ┐ ↓ custom Sampled{Float64} 10.0:10.0:30.0 ForwardOrdered Regular Points, → Z @@ -104,8 +100,7 @@ Change the `Sampling` trait: ```jldoctest set julia> set(da, :custom => DD.Irregular(10, 12), Z => DD.Regular(9.9)) -╭──────────────────────────╮ -│ 3×4 DimArray{Float64, 2} │ +┌ 3×4 DimArray{Float64, 2} ┐ ├──────────────────────────┴────────────────────────────────────────── dims ┐ ↓ custom Sampled{Float64} 10.0:10.0:30.0 ForwardOrdered Irregular Points, → Z Sampled{Float64} -20.0:10.0:10.0 ForwardOrdered Regular Points diff --git a/src/stack/methods.jl b/src/stack/methods.jl index 272cd2146..7e684ba84 100644 --- a/src/stack/methods.jl +++ b/src/stack/methods.jl @@ -72,8 +72,7 @@ julia> map(dims, axes(slices)) → X Base.OneTo(2)) julia> first(slices) -╭──────────────╮ -│ 3×5 DimStack │ +┌ 3×5 DimStack ┐ ├──────────────┴─────────────────────────────────── dims ┐ ↓ Y Sampled{Int64} 1:3 ForwardOrdered Regular Points, → Ti diff --git a/src/tables.jl b/src/tables.jl index 96a127ffa..9773a8495 100644 --- a/src/tables.jl +++ b/src/tables.jl @@ -65,8 +65,7 @@ To get dimension columns, you can index with `Dimension` (`X()`) or julia> using DimensionalData, Tables julia> a = DimArray(ones(16, 16, 3), (X, Y, Dim{:band})) -╭──────────────────────────────╮ -│ 16×16×3 DimArray{Float64, 3} │ +┌ 16×16×3 DimArray{Float64, 3} ┐ ├──────────────────────── dims ┤ ↓ X, → Y, ↗ band └──────────────────────────────┘