Skip to content

Should ordering be recognizable with a Union{Missing, Int64/Float64/...} #1139

@alex-s-gardner

Description

@alex-s-gardner
Using DimensionalData
x = Vector{Union{Missing, Int64}}(1:10)
x = X(x)
DimArray(1:10, x)

DD unable to recognize that x is forward ordered

10-element DimArray{Int64, 1} ┐
├───────────────────────────────┴───────────────────────── dims ┐
   X Categorical{Union{Missing, Int64}} [1, , 10] Unordered
└───────────────────────────────────────────────────────────────┘
  1   1
  2   2
  3   3
  4   4
  5   5
  6   6
  7   7
  8   8
  9   9
 10  10

checking if issorted works on x, returns true.

julia> issorted(x)
true

Using a non Union type

x = Vector{Int64}(1:10)
x = X(x)
DimArray(1:10, x)

the order is correctly recognized though I don't immediately know why this isn't Regular Points

 10-element DimArray{Int64, 1} ┐
├───────────────────────────────┴─────────────────────────── dims ┐
  ↓ X Sampled{Int64} [1, …, 10] ForwardOrdered Irregular Points
└─────────────────────────────────────────────────────────────────┘
  1   1
  2   2
  3   3
  4   4
  5   5
  6   6
  7   7
  8   8
  9   9
 10  10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions