-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Categorical dimensions are assigned ForwardOrdered or ReverseOrdered if they are ordered, e.g.:
julia> da = rand(Dim{:var}(["temperature", "soil_moisture", "precipitation"]))
┌ 3-element DimArray{Float64, 1} ┐
├────────────────────────────────┴───────────────────────────────────────── dims ┐
↓ var Categorical{String} ["temperature", …, "precipitation"] ReverseOrdered
└────────────────────────────────────────────────────────────────────────────────┘
"temperature" 0.148941
"soil_moisture" 0.915144
"precipitation" 0.576853
With #847 this might cause errors when indexing with a vector.
I would propose all Categorical lookups should be Unordered by default - there are very few cases where strings or symbols are really ordered (for Char you could argue otherwise though). There are many cases where a dimensions just isn't very big so the chance of it randomly being either ForwardOrdered or ReverseOrdered is quite big, and for dimensions of length 2 even 100%.
rafaqz
Metadata
Metadata
Assignees
Labels
No labels