Skip to content
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

Cannot parse some unit strings from scipy.constants #163

Closed
SimonHeybrock opened this issue Aug 20, 2021 · 4 comments
Closed

Cannot parse some unit strings from scipy.constants #163

SimonHeybrock opened this issue Aug 20, 2021 · 4 comments

Comments

@SimonHeybrock
Copy link
Contributor

Example: J mol^-1 K^-1 (the unit of R, the gas constant).

It works if I replace the first space by a *.

@SimonHeybrock
Copy link
Contributor Author

Here is a full list of the constants defined in scipy.constants (same as https://physics.nist.gov/cuu/Constants/Table/allascii.txt) that cannot be parsed (I give the unit in square brackets):

atomic mass unit-hartree relationship [E_h]
electron volt-hartree relationship [E_h]
Faraday constant for conventional electric current [C_90 mol^-1]
hertz-hartree relationship [E_h]
inverse meter-hartree relationship [E_h]
joule-hartree relationship [E_h]
kelvin-hartree relationship [E_h]
kilogram-hartree relationship [E_h]
natural unit of momentum in MeV/c [MeV/c]
Newtonian constant of gravitation over h-bar c [(GeV/c^2)^-2]
natural unit of mom.um in MeV/c [MeV/c]

@phlptp
Copy link
Collaborator

phlptp commented Aug 20, 2021

I will work on adding support for those

@phlptp
Copy link
Collaborator

phlptp commented Aug 20, 2021

Added E_h and support for conventional electrical units. The units with 'c' in them I am still debating what to do.

also fixed J mol^-1 K^-1

@phlptp
Copy link
Collaborator

phlptp commented Aug 20, 2021

ok, I am going to add a UNIT_USE_COOKING_UNITS flag which would shift some units to the cooking abbreviations but default to the science units. This enables the use of 'c' as the speed of light, which I think should fix your issues. Need to do a bit more testing and add the docs but I should have a PR by Monday

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

No branches or pull requests

2 participants