Skip to content

What semantics should comparison operators have on ODL 1.0 space-elements? #1695

@leftaroundabout

Description

@leftaroundabout

In current ODL, == is always a proper equality operator, i.e. it returns a boolean saying whether the left and right operands are equal.

Although I would say this is generally the correct thing to do for such operators, it cannot be denied that it is actually fairly useless in practice (two given floating-point arrays have a very low chance of being equal), does not generalize to inequalities <, >= etc., and contradicts what most array libraries and also the Python Array API prescribe.

Namely, to perform a point-wise comparison and give back an array saying for each element whether the elements at the same index agree in both of the input arrays.

@ozanoktem @Emvlt @janden we discussed this topic already, but the only clear conclusion was that ODL needs to be capable of representing such pointwise-boolean values. We should come to a consensus for how the comparison operations shall behave going forward. In old ODL it is at least consistent; in the 1.0 candidate it is currently a mix of several different approaches, which cannot stay like that. Below I list the possible options for what types the operations could be, and the tradeoffs; please vote and/or comment.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions