Title: Quantities that should be dimensionless are showing as still having units, causing errors with exp function · Issue #217 · python-quantities/python-quantities · GitHub
Open Graph Title: Quantities that should be dimensionless are showing as still having units, causing errors with exp function · Issue #217 · python-quantities/python-quantities
X Title: Quantities that should be dimensionless are showing as still having units, causing errors with exp function · Issue #217 · python-quantities/python-quantities
Description: Example code producing the bug: from quantities import C, N, m, A, mm, V, F, \ pF, H, ohm, Hz, MHz, S, s, kg, mS, rad import numpy as np from numpy import pi, exp epsilon0 = 8.854187817 * 10**(-12) * C**2/(N*m**2) mu0 = 4*pi*10**(-7) * N...
Open Graph Description: Example code producing the bug: from quantities import C, N, m, A, mm, V, F, \ pF, H, ohm, Hz, MHz, S, s, kg, mS, rad import numpy as np from numpy import pi, exp epsilon0 = 8.854187817 * 10**(-12)...
X Description: Example code producing the bug: from quantities import C, N, m, A, mm, V, F, \ pF, H, ohm, Hz, MHz, S, s, kg, mS, rad import numpy as np from numpy import pi, exp epsilon0 = 8.854187817 * 10**(-12)...
Opengraph URL: https://github.com/python-quantities/python-quantities/issues/217
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Quantities that should be dimensionless are showing as still having units, causing errors with exp function","articleBody":"Example code producing the bug:\n```\nfrom quantities import C, N, m, A, mm, V, F, \\\n pF, H, ohm, Hz, MHz, S, s, kg, mS, rad\nimport numpy as np\nfrom numpy import pi, exp\n\nepsilon0 = 8.854187817 * 10**(-12) * C**2/(N*m**2)\nmu0 = 4*pi*10**(-7) * N/(A**2)\n\ndef R_outer(r_center, Z_0, epsilonr):\n epsilon = epsilon0*epsilonr\n return r_center*(exp(2*pi*Z_0/np.sqrt(mu0/epsilon)) - 1)\n\nZ_0 = 75*ohm\nr_center = 0.6*mm\nR_outer(r_center, Z_0, 2.25)\n```\n\nRunning that code gives this error:\n\n\nIf I print out the expression inside the exp function, I get this:\n\n\nThe issue seems to be that it's treating `ohm` as if it were a base SI unit, rather than splitting it up into the base units and cancelling out common units, as it did for Coulombs and Newtons, and as the documentation for the simplify method says it should. It's easy to check that all those units do in fact cancel out by rewriting ohms in base units. ","author":{"url":"https://github.com/mikayla-eckelcifrese","@type":"Person","name":"mikayla-eckelcifrese"},"datePublished":"2023-03-02T07:10:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/217/python-quantities/issues/217"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3870dc89-a227-6945-4f11-6315946a5681 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C154:2D5ABD:237120:2F166C:696B0188 |
| html-safe-nonce | 7d62eed07c31afdf56aec59202a490bd9b1a3b69e30b3e5714d08ec48a4e3629 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTU0OjJENUFCRDoyMzcxMjA6MkYxNjZDOjY5NkIwMTg4IiwidmlzaXRvcl9pZCI6Ijk2NDIyMTEyNjA4ODI2MjAyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9d9ac4b575c39ba820f7a9d0acfce23c0737e45e6d5a1d1082a736d013c87974 |
| hovercard-subject-tag | issue:1606228548 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python-quantities/python-quantities/217/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f13389f95ed8db2a0797cab6d489838de25ca1a4769ee8a6a2c7d7f023419544/python-quantities/python-quantities/issues/217 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f13389f95ed8db2a0797cab6d489838de25ca1a4769ee8a6a2c7d7f023419544/python-quantities/python-quantities/issues/217 |
| og:image:alt | Example code producing the bug: from quantities import C, N, m, A, mm, V, F, \ pF, H, ohm, Hz, MHz, S, s, kg, mS, rad import numpy as np from numpy import pi, exp epsilon0 = 8.854187817 * 10**(-12)... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mikayla-eckelcifrese |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width