Skip to content

Dimensions

Dimensions are "wrapper types" that can be used to wrap any object to associate it with a named dimension.

X, Y, Z, Ti are predefined as types:

julia
julia> using DimensionalData

julia> X(1)
X 1
julia
julia> X(1), Y(2), Z(3)
(X 1, Y 2, Z 3)

You can also create Dim dimensions with any name:

julia
julia> Dim{:a}(1), Dim{:b}(1)
(a 1, b 1)

The wrapped value can be retrieved with val:

julia
julia> val(X(1))
1

DimensionalData.jl uses Dimensions everywhere:

  • Dimensions are returned from dims to specify the names of the dimensions of an object

  • They can wrap Lookups to associate the lookups with those names

  • To index into these objects, they can wrap indices like Int or a Selector

This symmetry means we can ignore how data is organized, and label and access it by name, letting DD work out the details for us.

Dimensions are defined in the Dimensions submodule, and some Dimension-specific methods can be brought into scope with:

julia
using DimensionalData.Dimensions