JuliaPhysics / JuliaPhysics/Unitful.jl
`isapprox` for heterogeneous arrays
- Dominant language
- Julia
- Stars
- 675
- Forks
- 124
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 1
Description
`isapprox` behaves incorrectly for heterogeneous arrays of quantities:
```julia
julia> a = Quantity[1u"s", 1u"minute"]
2-element Array{Quantity,1}:
1 s
1 minute
julia> isapprox(a,a)
false
```
This is due to the following implementation:
https://github.com/PainterQubits/Unitful.jl/blob/f6866eaffbb3a9150921cdcdacc967e8ff4a5c03/src/quantities.jl#L247-L248
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the heterogeneous-array example in Julia, then inspect the implementation linked at src/quantities.jl lines 247-248. Confirm the fix by checking that isapprox(a, a) returns true for arrays containing quantities with different units.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100