Use of Measurements.jl values works in some cases and fails in others.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the two Polynomials.fit examples with Measurement values and compare the successful degree-2 path with the failing degree-4 path. Start at the fit/vander path named in the stack trace and determine where Measurement values are converted to Float64. Done should establish whether fitting can support these values or clearly define the limitation and its handling.
Written by the indexing model from the issue text.
Description
Hi!
When using Measurement types, Polynomials plays nicely with Measurements.jl until the polynomials get large enough / complicated enough in fitting that Vandermonde is used. Is there any way to skip this and use a nieve fitting method when I'm needing to use these types to propagate error?
Working minimal example: You will find that the following works
julia> Polynomials.fit([1, 2, 3] .± 0.3, [4, 5, 6.3].±0.2, 2)
> Polynomials.Polynomial(3.3 ± 1.6 + 0.55 ± 1.9*x + 0.15 ± 0.49*x^2)
and this will not
julia> Polynomials.fit([1, 2, 3] .± 0.3, [4, 5, 6.3].±0.2, 4)
ERROR: MethodError: no method matching Float64(::Measurement{Float64})
Closest candidates are:
(::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:200
(::Type{T})(::T) where T<:Number at boot.jl:772
(::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
...
Stacktrace:
[1] convert(#unused#::Type{Float64}, x::Measurement{Float64})
@ Base .\number.jl:7
[2] setindex!(A::Vector{Float64}, x::Measurement{Float64}, i1::Int64)
@ Base .\array.jl:966
[3] vander(P::Type{Polynomials.Polynomial}, x::Vector{Measurement{Float64}}, degs::UnitRange{Int64})
- Dominant language
- Julia
- Stars
- 321
- Forks
- 81
- Avg merge
- 10h 1m
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaMath/Polynomials.jl
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
JuliaMath/Polynomials.jl#647 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
JuliaMath/Polynomials.jl#641 ·
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
JuliaMath/Polynomials.jl#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
JuliaMath/Polynomials.jl#620 · 6 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
JuliaMath/Polynomials.jl#585 · 7 comments ·
All issues in JuliaMath/Polynomials.jl
Similar issues
-
io
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaGPU/GPUArrays.jl#837 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day