Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods for floatmin/floatmax #72

Merged
merged 4 commits into from
May 21, 2020

Conversation

stillyslalom
Copy link
Contributor

I ran into a missing method error when curve-fitting a vector of Measurements using Polynomials.jl:

julia> using Measurements, Polynomials, GenericLinearAlgebra

julia> fit([1, 2], (rand(2) .± rand(2)), 1)
ERROR: MethodError: no method matching floatmin(::Type{Measurement{Float64}})
Closest candidates are:
  floatmin() at float.jl:776
  floatmin(::Type{Float16}) at float.jl:738
  floatmin(::Type{Float32}) at float.jl:739

Fixed with

Base.floatmin(::Type{Measurement{T}}) where {T<:AbstractFloat} = floatmin(T)
Base.floatmax(::Type{Measurement{T}}) where {T<:AbstractFloat} = floatmax(T)

Resolves a missing method error when using Polynomials.jl to curve-fit an array of measurements
Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I completely missed this pull request!

src/math.jl Outdated Show resolved Hide resolved
Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2020

Codecov Report

Merging #72 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
+ Coverage   95.50%   95.51%   +0.01%     
==========================================
  Files          12       12              
  Lines         556      558       +2     
==========================================
+ Hits          531      533       +2     
  Misses         25       25              
Impacted Files Coverage Δ
src/math.jl 99.65% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22f078c...3d25a4b. Read the comment docs.

@stillyslalom
Copy link
Contributor Author

@giordano good to merge?

@giordano
Copy link
Member

Yes, thank you so much!

@giordano giordano merged commit 44eb053 into JuliaPhysics:master May 21, 2020
@stillyslalom
Copy link
Contributor Author

@giordano can you bump the version to make this available on a release?

@giordano
Copy link
Member

giordano commented Sep 8, 2020

Done, it's in v2.3.0 now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants