Skip to content

inconsistent behaviour of hasdim on X vs Dim{:X} #953

@tiemvanderdeure

Description

@tiemvanderdeure

Stumbled across this behaviour while making some tests for materializing tables into dimarrays.

using DimensionalData: Dim, X, hasdim
ds1 = (X(1:10),)
ds2 = (Dim{:X}(1:10),)
hasdim(ds1, X) # true
hasdim(ds1, :X) # true
hasdim(ds2, X) # false
hasdim(ds2, :X) # true
ds1 == ds2 # false

Is this intended behaviour? I thought everything just worked through symbols.

In any case this is confusing because it's not obvious at all that something has Dim{:X} dimension and not X, since these behave the same way otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions