Skip to content

Quantity with units returns True for __eq__ with plain numpy array  #146

@bjodah

Description

@bjodah

Consider this:

In [10]: 2.1*pq.m == np.array(2.1)
Out[10]: True

I would have expected it to return True only if the Quantity instance was dimensionless.
What do others think?

EDIT:
since the numbers (arrays) cannot be added to each other, I think it really should be an error:

>>> 3*pq.m + 3
ValueError ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions