JuliaPhysics / JuliaPhysics/Unitful.jl

`uconvertp`/`uconvertrp` fail to convert dimensionless quantities to `Gain`

Open
#727 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

logarithmic
Dominant language
Julia
Stars
675
Forks
124
Avg merge
3h 38m
Merged PRs (30d)
1

Description

The following should return -60dB, since 1mm/m == 0.001:

julia> uconvertrp(u"dB", 1.0u"mm/m")
ERROR: 1.0 is not obviously a ratio of power or root-power quantities; use `uconvertrp` or `uconvertp` instead.
[…]

The error message is even saying that one should use uconvertrp or uconvertp, even though that is what was used.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Julia example with uconvertrp(u"dB", 1.0u"mm/m"), then trace the uconvertrp and uconvertp entry points to find where dimensionless quantities are rejected. Done means the example converts 1.0u"mm/m" to -60dB without producing the contradictory error message.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.