diff --git a/.nojekyll b/.nojekyll index c8bfcb5..93221d7 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -a77169d8 \ No newline at end of file +5b97d39c \ No newline at end of file diff --git a/index.html b/index.html index 58f7b3e..3a66cc7 100644 --- a/index.html +++ b/index.html @@ -423,8 +423,9 @@

Why another named array package?

  • Geospatial data
  • @@ -436,8 +437,8 @@

    Why another named array package?

    -
    -

    Dimensions

    +
    +

    Concepts: Dimensions

    @@ -475,7 +476,6 @@

    Dimension are wrappers


    -
    “Standard” dimensions (90% of spatial data):

    X, Y, Z, Ti
    @@ -483,37 +483,58 @@

    Dimension are wrappers

    (X, Y, Z, Ti)
    -


    -Arbitrary dimensions (everything else)

    +
    +

    Arbitrary dimensions (everything else)

    Dim{:name}
    Dim{:name}
    +
    +

    Lookups

    • Hold lookup values along a dimension
    • -
    • AbstracArrays with lookup traits like Points or Intervals
    • -
    • Sampled and Categorical are the most common
    • +
    • And traits like Points or Intervals
    • mostly detected automatically in array constructors
    • -
    • advanced topic - see the docs!
    +
    +

    You can define them manually when you need to:

    +
    +
    using DimensionalData.Lookups
    +l = Sampled(1:10; sampling=Intervals(Start()), order=ForwardOrdered(), span=Regular())
    +
    +
    Sampled{Int64} ForwardOrdered Regular Intervals{Start}
    +wrapping: 1:10
    +
    +
    +


    +

    +
    +
    Sampled <: AbstractSampled <: Aligned <: Lookup <: AbstractVector
    +
    +
    false
    +
    +
    +
    -
    -

    DimArray <: AbstractDimArray

    - +
    +

    DimArray Constructors

    +
      +
    • DimArray <: AbstractDimArray <: AbstractArray
    • +

    1 dimensional


    -
    -
    A = DimArray([1, 2, 3], X([:a, :b, :c]))
    +
    +
    A = DimArray([1, 2, 3], X([:a, :b, :c]))
    ╭─────────────────────────────╮
     │ 3-element DimArray{Int64,1} │
    @@ -529,8 +550,8 @@ 

    1 dimensional

    N dimensional

    With standard dimensions in a Tuple:

    -
    -
    A = DimArray(rand(3, 4), (X([:a, :b, :c]), Y(10.0:10:40.0)))
    +
    +
    A = DimArray(rand(3, 4), (X([:a, :b, :c]), Y(10.0:10:40.0)))
    ╭─────────────────────────╮
     │ 3×4 DimArray{Float64,2} │
    @@ -538,18 +559,18 @@ 

    N dimensional

    ↓ X Categorical{Symbol} [:a, :b, :c] ForwardOrdered, → Y Sampled{Float64} 10.0:10.0:40.0 ForwardOrdered Regular Points └───────────────────────────────────────────────────────────────────┘ - ↓ → 10.0 20.0 30.0 40.0 - :a 0.241505 0.0282003 0.462848 0.337448 - :b 0.370021 0.6171 0.588097 0.499839 - :c 0.842621 0.509002 0.762115 0.143347
    + ↓ → 10.0 20.0 30.0 40.0 + :a 0.981993 0.513781 0.0573086 0.133294 + :b 0.597572 0.938506 0.687245 0.831078 + :c 0.243421 0.560166 0.854638 0.592527

    With arbitrary Dim dimensions, in a NamedTuple:

    -
    -
    DimArray(rand(3, 4), (a=[:a, :b, :c], b=10.0:10:40.0))
    +
    +
    DimArray(rand(3, 4), (a=[:a, :b, :c], b=10.0:10:40.0))
    ╭─────────────────────────╮
     │ 3×4 DimArray{Float64,2} │
    @@ -557,18 +578,18 @@ 

    N dimensional

    ↓ a Categorical{Symbol} [:a, :b, :c] ForwardOrdered, → b Sampled{Float64} 10.0:10.0:40.0 ForwardOrdered Regular Points └───────────────────────────────────────────────────────────────────┘ - ↓ → 10.0 20.0 30.0 40.0 - :a 0.427305 0.633447 0.151995 0.998212 - :b 0.0411998 0.983792 0.546416 0.0624934 - :c 0.796127 0.0912018 0.415789 0.990061
    + ↓ → 10.0 20.0 30.0 40.0 + :a 0.819396 0.894635 0.768049 0.093845 + :b 0.427051 0.650875 0.0872013 0.500716 + :c 0.215033 0.896086 0.922141 0.876665

    Shorthands: rand, fill, zeros, ones

    -
    -
    rand(X(6), Y(10:2:20))
    +
    +
    rand(X(6), Y(10:2:20))
    ╭─────────────────────────╮
     │ 6×6 DimArray{Float64,2} │
    @@ -576,28 +597,30 @@ 

    N dimensional

    ↓ X, → Y Sampled{Int64} 10:2:20 ForwardOrdered Regular Points └──────────────────────────────────────────────────────────┘ - 10 12 14 16 18 20 - 0.0775471 0.981323 0.324893 0.925181 0.229754 0.747415 - 0.847143 0.570464 0.434556 0.78922 0.578236 0.304476 - 0.36445 0.762368 0.120009 0.821311 0.73623 0.814217 - 0.752036 0.513882 0.143335 0.472154 0.400025 0.178112 - 0.129693 0.542092 0.0298521 0.260005 0.247613 0.35124 - 0.0366645 0.891387 0.384627 0.270451 0.0363059 0.310466
    + 10 12 14 16 18 20 + 0.487087 0.972023 0.633484 0.662478 0.928678 0.976848 + 0.0559741 0.543368 0.311436 0.716113 0.565865 0.938829 + 0.150337 0.507311 0.451984 0.803921 0.647749 0.84485 + 0.738515 0.444562 0.707928 0.339974 0.592118 0.284115 + 0.688352 0.974059 0.928612 0.296633 0.221053 0.883975 + 0.943116 0.752221 0.169269 0.0503815 0.758892 0.316402
    -
    -

    DimStack <: AbstractDimStack

    - +
    +

    DimStack Constructors

    +
      +
    • DimStack <: AbstractDimStack
    • +

    Layers with the same dimensions


    -
    -
    ds = X([:a, :b, :c]), Ti(10.0:10:40.0)
    -S = DimStack((layer1=rand(Float32, 3, 4), layer2=zeros(Bool, 3, 4)), ds)
    +
    +
    ds = X([:a, :b, :c]), Ti(10.0:10:40.0)
    +S = DimStack((layer1=rand(Float32, 3, 4), layer2=zeros(Bool, 3, 4)), ds)
    ╭──────────────╮
     │ 3×4 DimStack │
    @@ -615,9 +638,9 @@ 

    Layers with the same dimensions

    Layers with different dimensions:


    -
    -
    x, ti = X([:a, :b, :c]), Ti(10.0:10:40.0)
    -DimStack((twodims=rand(Float32, x, ti), onedim=zeros(Bool, x)))
    +
    +
    x, ti = X([:a, :b, :c]), Ti(10.0:10:40.0)
    +DimStack((twodims=rand(Float32, x, ti), onedim=zeros(Bool, x)))
    ╭──────────────╮
     │ 3×4 DimStack │
    @@ -634,30 +657,30 @@ 

    Layers with different dimensions:

    Named indexing

    DimArray:

    -
    -
    using BenchmarkTools
    -@btime $A[3, 4]        # Base Julia Array syntax
    -@btime $A[Y(4), X(3)]  # Dimension wrappers
    -@btime $A[Y=4, X=3]    # Keyword syntax
    +
    +
    using BenchmarkTools
    +@btime $A[3, 4]        # Base Julia Array syntax
    +@btime $A[Y(4), X(3)]  # Dimension wrappers
    +@btime $A[Y=4, X=3]    # Keyword syntax
      3.095 ns (0 allocations: 0 bytes)
       3.095 ns (0 allocations: 0 bytes)
       3.095 ns (0 allocations: 0 bytes)
    -
    0.14334711233192854
    +
    0.5925272105664855

    DimStack:

    -
    -
    @btime $S[Ti(4), X(3)] # Dimension wrappers
    -@btime $S[Ti=4, X=3]   # Keyword syntax
    +
    +
    @btime $S[Ti(4), X(3)] # Dimension wrappers
    +@btime $S[Ti=4, X=3]   # Keyword syntax
    -
      3.406 ns (0 allocations: 0 bytes)
    -  3.706 ns (0 allocations: 0 bytes)
    +
      3.145 ns (0 allocations: 0 bytes)
    +  3.406 ns (0 allocations: 0 bytes)
    -
    (layer1 = 0.15278113f0, layer2 = false)
    +
    (layer1 = 0.33329403f0, layer2 = false)
    @@ -674,15 +697,15 @@

    At


    Find exact or approximate matches

    -
    -
    A = DimArray([1, 2, 3, 4], (X([10.0, 20.0, 40.0, 80.0])))
    -A[X(At(80.0))]
    +
    +
    A = DimArray([1, 2, 3, 4], (X([10.0, 20.0, 40.0, 80.0])))
    +A[X(At(80.0))]
    4
    -
    -
    A[X(At(80.09; atol=0.1))]
    +
    +
    A[X(At(80.09; atol=0.1))]
    4
    @@ -693,8 +716,8 @@

    Near


    Find the closest match

    -
    -
    A[X(Near(85))]
    +
    +
    A[X(Near(85))]
    4
    @@ -705,12 +728,12 @@

    Contains


    Find the interval that contains a value

    -
    -
    # Define a DimArray with Intervals lookup
    -using DimensionalData.Lookups
    -A = DimArray(100:100:9900, X(1.0:1.0:99.0; sampling=Intervals(Start())))
    -# Index with Contains
    -A[X(Contains(9.5))]
    +
    +
    # Define a DimArray with Intervals lookup
    +using DimensionalData.Lookups
    +A = DimArray(100:100:9900, X(1.0:1.0:99.0; sampling=Intervals(Start())))
    +# Index with Contains
    +A[X(Contains(9.5))]
    900
    @@ -721,8 +744,8 @@

    .. (an IntervalSets.jl Interval)


    Select data inside an interval

    -
    -
    A[X=9.5 .. 15]
    +
    +
    A[X=9.5 .. 15]
    ╭─────────────────────────────╮
     │ 5-element DimArray{Int64,1} │
    @@ -742,8 +765,8 @@ 

    Where


    Make dimensional queries

    -
    -
    A[X=Where(isodd)]
    +
    +
    A[X=Where(isodd)]
    ╭──────────────────────────────╮
     │ 50-element DimArray{Int64,1} │
    @@ -772,65 +795,67 @@ 

    Plotting

    Plots.jl

    -
    -
    using Plots
    -Plots.scatter(rand(X([:a, :b, :c, :d])))
    +
    +
    using Plots
    +Plots.scatter(rand(X([:a, :b, :c, :d])))
    - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +

    Makie.jl

    -
    -
    using CairoMakie, Distributions
    -Makie.heatmap(rand(Normal(), X(100:10:200), Y([:a, :b, :c])))
    +
    +
    using CairoMakie, Distributions
    +Makie.heatmap(rand(Normal(), X(100:10:200), Y([:a, :b, :c])))
    -
    +

    Integrations

    @@ -841,16 +866,18 @@

    Integrations

    Some packages building on DimensionalData.jl

    +

    Thanks

    diff --git a/index_files/figure-revealjs/cell-24-output-1.svg b/index_files/figure-revealjs/cell-26-output-1.svg similarity index 68% rename from index_files/figure-revealjs/cell-24-output-1.svg rename to index_files/figure-revealjs/cell-26-output-1.svg index 7504a61..27ca151 100644 --- a/index_files/figure-revealjs/cell-24-output-1.svg +++ b/index_files/figure-revealjs/cell-26-output-1.svg @@ -2,43 +2,43 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -52,80 +52,80 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/search.json b/search.json index a2b7530..fd88f31 100644 --- a/search.json +++ b/search.json @@ -4,7 +4,7 @@ "href": "index.html#why-another-named-array-package", "title": "DimensionalData.jl", "section": "Why another named array package?", - "text": "Why another named array package?\n\n\nGeospatial data\n\nnamed dimensions and lookup values are ubiquitous\nthere are a lot of possible lookup configurations\nmulti-array datasets are common (with shared dimensions)\n\n\n\n\nxarray" + "text": "Why another named array package?\n\n\nGeospatial data\n\nnamed dimensions and lookup values are ubiquitous\nselecting spatial and temporal subsets is ubiquitous\nthere are a lot of possible lookup configurations\nmulti-array datasets are also common\n\n\n\n\nxarray" }, { "objectID": "index.html#dimension-are-wrappers", @@ -25,7 +25,7 @@ "href": "index.html#n-dimensional", "title": "DimensionalData.jl", "section": "N dimensional", - "text": "N dimensional\nWith standard dimensions in a Tuple:\n\nA = DimArray(rand(3, 4), (X([:a, :b, :c]), Y(10.0:10:40.0)))\n\n╭─────────────────────────╮\n│ 3×4 DimArray{Float64,2} │\n├─────────────────────────┴─────────────────────────────────── dims ┐\n ↓ X Categorical{Symbol} [:a, :b, :c] ForwardOrdered,\n → Y Sampled{Float64} 10.0:10.0:40.0 ForwardOrdered Regular Points\n└───────────────────────────────────────────────────────────────────┘\n ↓ → 10.0 20.0 30.0 40.0\n :a 0.241505 0.0282003 0.462848 0.337448\n :b 0.370021 0.6171 0.588097 0.499839\n :c 0.842621 0.509002 0.762115 0.143347" + "text": "N dimensional\nWith standard dimensions in a Tuple:\n\nA = DimArray(rand(3, 4), (X([:a, :b, :c]), Y(10.0:10:40.0)))\n\n╭─────────────────────────╮\n│ 3×4 DimArray{Float64,2} │\n├─────────────────────────┴─────────────────────────────────── dims ┐\n ↓ X Categorical{Symbol} [:a, :b, :c] ForwardOrdered,\n → Y Sampled{Float64} 10.0:10.0:40.0 ForwardOrdered Regular Points\n└───────────────────────────────────────────────────────────────────┘\n ↓ → 10.0 20.0 30.0 40.0\n :a 0.981993 0.513781 0.0573086 0.133294\n :b 0.597572 0.938506 0.687245 0.831078\n :c 0.243421 0.560166 0.854638 0.592527" }, { "objectID": "index.html#layers-with-the-same-dimensions", @@ -95,7 +95,7 @@ "href": "index.html#some-packages-building-on-dimensionaldata.jl", "title": "DimensionalData.jl", "section": "Some packages building on DimensionalData.jl", - "text": "Some packages building on DimensionalData.jl\n\nRasters.jl\nYAXArrays.jl\nClimateBase.jl\nAstroImages.jl\nArviz.jl\nDynamicGrids.jl\nPyramidScheme.jl\nJump.jl (extension)" + "text": "Some packages building on DimensionalData.jl\n\n\nRasters.jl\nYAXArrays.jl\nClimateBase.jl\nAstroImages.jl\nPyramidScheme.jl\nArviz.jl\nJuMP.jl (extension)\nDynamicGrids.jl" }, { "objectID": "index.html#thanks", diff --git a/sitemap.xml b/sitemap.xml index b9adb74..3731ff8 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,6 +2,6 @@ https://rafaqz.github.io/JuliaCon2024-DD/index.html - 2024-07-09T23:43:09.216Z + 2024-07-10T13:02:41.726Z