Title: Improved behavior of comparison between quantities by wagenadl · Pull Request #249 · python-quantities/python-quantities · GitHub
Open Graph Title: Improved behavior of comparison between quantities by wagenadl · Pull Request #249 · python-quantities/python-quantities
X Title: Improved behavior of comparison between quantities by wagenadl · Pull Request #249 · python-quantities/python-quantities
Description: For quantities A and B of unequal dimensionality, the == operator now returns an array of the same shape that numpy would return if A and B were different and filled with False. In particular, if both A and B are scalar arrays, the result is a scalar False. Previously, a scalar array (np.array(False)) would be returned under these circumstances. If A and B do not have compatible sizes, an exception is generated. The != operator behaves the same except that it fills the result with True values. The other comparison operators now raise exceptions if a quantity that is not dimensionless is compared to a plain number. For effectively dimensionless quantities the comparison is now consistent. Previously, if n = pq.s * pq.kHz then n < 2 would return True but n.simplified < 2 would return False. Now, both return False. Comparison between incompatible quantities raises exceptions as before. Closes #245
Open Graph Description: For quantities A and B of unequal dimensionality, the == operator now returns an array of the same shape that numpy would return if A and B were different and filled with False. In particular, if b...
X Description: For quantities A and B of unequal dimensionality, the == operator now returns an array of the same shape that numpy would return if A and B were different and filled with False. In particular, if b...
Opengraph URL: https://github.com/python-quantities/python-quantities/pull/249
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8f5aa3e1-b7f3-2927-90ed-d89d2d585d7d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A770:340321:F431F1:13B922C:69742DB8 |
| html-safe-nonce | 993257c8ffbe1dba5762ab0d1d5796f1ee550ca61a627e5cb0cfb48e007f016d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzcwOjM0MDMyMTpGNDMxRjE6MTNCOTIyQzo2OTc0MkRCOCIsInZpc2l0b3JfaWQiOiI2MjgwNzQxMjk1MzE2MjgyODA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3b55f715cf375f63cf40bb6f84cdfaff94c74b6c921762cb60bdc2e93d5f5ef7 |
| hovercard-subject-tag | pull_request:2182934378 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-quantities/python-quantities/pull/249/files |
| twitter:image | https://avatars.githubusercontent.com/u/11696507?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/11696507?s=400&v=4 |
| og:image:alt | For quantities A and B of unequal dimensionality, the == operator now returns an array of the same shape that numpy would return if A and B were different and filled with False. In particular, if b... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f0c542b740cf8c6c6deff23a0eeffd05a0e8bd35565559ca5ec1535bcbb67e5c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python-quantities/python-quantities git https://github.com/python-quantities/python-quantities.git |
| octolytics-dimension-user_id | 222003 |
| octolytics-dimension-user_login | python-quantities |
| octolytics-dimension-repository_id | 560911 |
| octolytics-dimension-repository_nwo | python-quantities/python-quantities |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 560911 |
| octolytics-dimension-repository_network_root_nwo | python-quantities/python-quantities |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4e27a77ef0bf22cd9328967ddc1e1c3dfa6ffe51 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width