-
Notifications
You must be signed in to change notification settings - Fork 1
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
uconvert(PVector, units)
not typestable
#27
Comments
elehcim
changed the title
typestable
Nov 29, 2021
uconvert(PVector, units)
uconvert(PVector, units)
not typestable
type instability comes from julia> using Unitful, UnitfulAstro
julia> a = 1.0f0u"kpc/Gyr"
┌ Warning: Symbol Gyr was found in multiple registered unit modules.
│ We will use the one from UnitfulAstro.
└ @ Unitful E:\.julia\packages\Unitful\9janP\src\user.jl:589
1.0f0 kpc Gyr^-1
julia> b = uconvert(u"km/s", a)
0.9777922216807892 km s^-1
julia> typeof(b)
Quantity{Float64, 𝐋 𝐓 ^-1, Unitful.FreeUnits{(km, s^-1), 𝐋 𝐓 ^-1, nothing} |
Yes, you're right |
It requires changes upstream to Unitful. For now I'll just cast each component separately |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a problem regarding unit conversion which seems to change the datatype.
For example:
but I'd like it to stay a
Float32
.See JuliaAstroSim/AstroIO.jl#10 (comment)
The text was updated successfully, but these errors were encountered: