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

unit() function not supporting log units #528

Open
DanDeepPhase opened this issue Mar 16, 2022 · 0 comments
Open

unit() function not supporting log units #528

DanDeepPhase opened this issue Mar 16, 2022 · 0 comments
Labels
logarithmic logarithmic scales (decibels, nepers, …)

Comments

@DanDeepPhase
Copy link

As per the title, the unit function doesn't work for log units. Tested for dB and V_mag (UnitfulAstro)

julia> unit(1.0u"dB") == u"dB"
false

julia> unit(1.0u"m") == u"m"
true

julia> unit(1.0u"rad") == u"rad"
true

The return is as below. I compared this to radians for another NoDims unit:

julia> unit(1.0u"dB") |> typeof
Unitful.FreeUnits{(), NoDims, nothing}

julia> unit(1.0u"rad") |> typeof
Unitful.FreeUnits{(rad,), NoDims, nothing}
@sostock sostock added the logarithmic logarithmic scales (decibels, nepers, …) label Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logarithmic logarithmic scales (decibels, nepers, …)
Projects
None yet
Development

No branches or pull requests

2 participants