-
Notifications
You must be signed in to change notification settings - Fork 22
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
Corrections for Julia 0.6.0 #13
Conversation
src/performance_profiles.jl
Outdated
@@ -13,21 +13,22 @@ function performance_ratios(T :: Array{Float64,2}; logscale :: Bool=true) | |||
|
|||
(np, ns) = size(T); # Number of problems and number of solvers. | |||
|
|||
T[isinf(T)] = NaN; | |||
T[T .< 0] = NaN; | |||
T[isinf.(T)] = Inf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this one really necessary then? Does it do anything?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is should be T[isnan.(T)] = Inf
? This way, maximum
is also kept.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right it should be isnan
instead of is inf. But I don't see why maximum
should be kept. At least on my tests with isnan
the maximum
function still produce bad performance profiles
src/performance_profiles.jl
Outdated
logscale && (r = log2(r)); | ||
max_ratio = maximum(r); | ||
logscale && (r = log2.(r)); | ||
max_ratio = findmax(r)[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was maximum
not working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Julia 0.5.2 maximum([2.0, NaN])
returned 2.0 and findmax([2.0, NaN])[1]
returned 2.0 as well. But in Julia 0.6.0 maximum([2.0, NaN])
returns NaN and findmax([2.0, NaN])[1]
returns 2.0. That's why I changed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a bug in Julia. See
- Inconsistency between
findmax
andmaximum
with respect toNaN
JuliaLang/julia#22337 and - https://discourse.julialang.org/t/inconsistency-between-findmax-and-maximum-with-respect-to-nan/4214/3.
It's time to use NaNMath.jl:
julia> NaNMath.max(2, NaN)
2.0
julia> NaNMath.maximum([2, NaN])
2.0
Thanks. We also need to add |
I've added NaNMath in REQUIRE! |
REQUIRE
Outdated
@@ -1,2 +1,5 @@ | |||
julia 0.5 | |||
Plots | |||
|
|||
julia 0.6 | |||
Plots, NaNMath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add NaNMath
to the list on line 3.
ps: the failure on Windows 32 bit is known and fixed in 0.7-dev : JuliaPlots/Plots.jl#968. It may be backported to Julia 0.6?! |
Thank you! |
I've made some changes so that the performance profiles appear correctly.
Basically, NaN have been changed to Inf and then to NaN again. Now it outputs the same things that it did in Julia 0.5.2.