JuliaPhysics / JuliaPhysics/Unitful.jl

printing types of unit quantities loses information

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

Description

Example:
```
julia> using Unitful: 𝐌,𝐋,L,mg

julia> typeof(1u"mg/L")
Quantity{Int64,𝐌*𝐋^-3,Unitful.FreeUnits{(mg, L^-1),𝐌*𝐋^-3,nothing}}

julia> 1u"mg/L" isa Quantity{Int64,𝐌*𝐋^-3,Unitful.FreeUnits{(mg, L^-1),𝐌*𝐋^-3,nothing}}
false
```
So if I copy and paste the representation of `typeof(1u"mg/L")`, it is not the correct type.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Julia REPL example using Unitful, typeof, Quantity, and FreeUnits, then trace how the type representation is printed. Done means the displayed type for typeof(1u"mg/L") can be copied and used as the equivalent type expression without losing information.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.