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 make 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:

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

  • they wrap Lookups to associate the lookups with those names

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

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

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

julia
using DimensionalData.Dimensions