Skip to content

Comparison between quantities and plain numbers is inconsistent and unsafe #245

@wagenadl

Description

@wagenadl

If I have a quantity with a unit, e.g.,

 t = 50 * pq.ms

then

t > 1

returns True whereas

t.simplified > 1

returns False. Arguably, both should raise a ValueError just like

t - 1

does in this example.

If the community agrees, I would be happy to prepare a pull request to change the behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions