Skip to content

implement isequal and clarify == for DimArrays with missing values #1107

@tiemvanderdeure

Description

@tiemvanderdeure

As of now:

using DimensionalData
da = DimArray([1, missing], X(1:2))
da2 = DimArray([1, missing], Y(1:2))
da == da2 # errors!
isequal(da, da2) # true

The error is because == is defined as parent(A1) == parent(A2) && dims(A1) == dims(A2) - if the first returns missing than this errors, so we should just swap the order here.

The point of isequal is that it handles missing values well - which is really neat because Rasters tend to have lots of missing values. Here it returns true because it uses the fallback definition and so never checks the dimensions.

If we implement these properly then probably we don't need additional definitions in e.g. Rasters.jl

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