You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using Unitful
julia> @unit M "M" Molar 1u"mol/L" true
M
julia> 1M
1 M
julia> 1u"M"
ERROR: Symbol M could not be found in registered unit modules.
edit: Expected behavior is that 1M==1u"M"
The text was updated successfully, but these errors were encountered:
I wouldn't expect this to work, since Main isn't a registered unit module by default. On the other hand, it appears like it was not possible before to even register Main as a unit module. I've patched master, it should work for you now provided you do Unitful.register(Main) before using @u_str, like:
julia> using Unitful
INFO: Recompiling stale cache file /Users/ajkeller/.julia/lib/v0.6/Unitful.ji for module Unitful.
julia> Unitful.register(Main)
2-element Array{Module,1}:
Unitful
Main
julia> @unit M "M" Molar 1u"mol/L" true
M
julia> 1M
1 M
julia> 1u"M"
1 M
Following the docs I tried:
edit: Expected behavior is that
1M==1u"M"
The text was updated successfully, but these errors were encountered: