Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wagenadl opened this issue Nov 16, 2024 · 1 comment · May be fixed by #249
Open

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

wagenadl opened this issue Nov 16, 2024 · 1 comment · May be fixed by #249

Comments

@wagenadl
Copy link
Contributor

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.

@wagenadl wagenadl linked a pull request Nov 16, 2024 that will close this issue
@bjodah
Copy link
Contributor

bjodah commented Nov 18, 2024

Also related: gh-146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants