-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add unit "angstrom" #271
Add unit "angstrom" #271
Conversation
Wiki for angstrom: https://en.wikipedia.org/wiki/Angstrom |
I would suggest adding a line Was it necessary to write |
Note that Angstrom is already in |
That's a good point. I do not know why they need this unit since "angstrom" is so small to be astronomical. I do not know whether it would impact people who write using UnitfulAstro: angstrom if we merge this PR into Unitful.jl and ask UnitfulAstro.jl maintainers to remove it. But it sounds weird to me that I need to install UnitfulAstro.jl in my field: dealing with atoms and molecules. |
Wavelengths 🙂
I'm sure we'll find a way to not break users' code if angstrom is added here 😉 |
The reason I used julia> @unit angstrom "Å" Angstrom (1 // 10) * Unitful.nm false
julia> Unitful.register(Main)
julia> ustrip(u"cm", 1u"angstrom")
1//100000000 However, if I use UnitfulAstro.jl, it will be converted to floats: julia> using UnitfulAstro
julia> ustrip(u"cm", 1u"angstrom")
1.0e-8 However, julia> ustrip(u"m", 1u"cm")
1//100 So the relation breaks. @unit inch "inch" Inch (254//10000)*m false
@unit mil "mil" Mil (1//1000)*inch false |
Hi, would you mind pointing out where should I add |
@@ -182,6 +182,7 @@ const R∞ = 10_973_731.568_160/m # (21) Rydberg constant | |||
@unit ft "ft" Foot 12inch false | |||
@unit yd "yd" Yard 3ft false | |||
@unit mi "mi" Mile 1760yd false | |||
@unit angstrom "Å" Angstrom (1//10)*Unitful.nm false | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const Å = angstrom
should go immediately following the @unit
definition.
My question was really about whether the
At least the |
mentioned in #271 (comment)
Codecov Report
@@ Coverage Diff @@
## master #271 +/- ##
=======================================
Coverage 78.34% 78.34%
=======================================
Files 15 15
Lines 1076 1076
=======================================
Hits 843 843
Misses 233 233
Continue to review full report at Codecov.
|
Oh, I was just not aware of that. I have updated as you suggested. |
Any updated information? |
Unitful.jl has merged my PR PainterQubits/Unitful.jl#271
…19-11-27-08-09-32-349-3759351010 CompatHelper: add new compat entry for "Unitful" at version "0.18" Because I want the unit "angstrom" merged in PainterQubits/Unitful.jl#271
I was going to contribute to UnitfulAtomic.jl, but the author asks me to try here first.
I did not find any abbreviation of "angstrom" as "mi" does. But requiring input
Å
as a unit is harder than just typingangstrom
. If you have better ideas, I would like to adopt.