JuliaPhysics / JuliaPhysics/Unitful.jl

Cant simplify electrical units as expected (S*Ω)

Open
#747 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
675
Forks
124
Avg merge
3h 38m
Merged PRs (30d)
1

Description

Hi all, I hope this is not a repeat question.

I am trying to do an operation equivalent to this, but it does not work:
`uconvert(u"1/km", 1.0u"S" * 1.0u"Ω" * 1.0u"1/km")`

> MethodError: no method matching uconvert(::Unitful.Quantity{Int64, 𝐋^-1, Unitful.FreeUnits{(km^-1,), 𝐋^-1, nothing}}, ::Unitful.Quantity{Float64, 𝐋^-1, Unitful.FreeUnits{(km^-1, Ω, S), 𝐋^-1, nothing}})

However, similar situations where units cancel each other out work just fine:
`uconvert(u"Ω/km",1.0*u"1/km" * 1.0u"V"/1.0u"A")`

> 1.0 Ω km^-1

Is this a bug or am I misunderstanding what this package can do? Should I be using a different function?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing both uconvert examples from the issue in Unitful.jl and compare how S*Ω is represented with the V/A expression. No file or test is named; done means establishing whether the differing simplification is a bug or supported usage and identifying the relevant implementation or test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.