Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
@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 + 3ValueError ...

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp