-
Notifications
You must be signed in to change notification settings - Fork 39
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
[WIP] Update for Julia 0.7 and 1.0 #96
Conversation
@@ -1,4 +1,4 @@ | |||
julia 0.5 | |||
julia 0.7 |
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 it fine to drop both Julia 0.5 and 0.6 support on master? Otherwise some compatibility additions are needed.
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.
Yes, absolutely!
test/test.jl
Outdated
@@ -4,10 +4,10 @@ function profile_test(n) | |||
for i = 1:n | |||
A = randn(100,100,20) | |||
m = maximum(A) | |||
Afft = fft(A) | |||
Am = mapslices(sum, A, 2) | |||
# Afft = fft(A) |
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 assume the fft
call is only intended to provide some nontrivial amount of computations that can be profiled. With FFTW having been moved out of Base, it might be better to replace it with something that doesn't require a testing dependency. Or is it fine to just skip 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.
Agreed better not to use fft
. You can either replace it or skip it, either is fine with me.
The current stumbling block is that the conditional loading and
Any hints on how to proceed with this? |
No idea whether that import fix is correct, but it's good enough to run into Gtk dependency errors instead. Some kind of progress. |
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.
This looks great, thanks for doing it.
Gtk should come very soon, it will be exciting to be ready here.
@@ -1,4 +1,4 @@ | |||
julia 0.5 | |||
julia 0.7 |
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.
Yes, absolutely!
src/ProfileView.jl
Outdated
return haskey(ENV, "DISPLAY") | ||
end | ||
|
||
include("ProfileViewSVG.jl") | ||
include("ProfileViewGtk.jl") |
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.
So, these used to be loaded conditionally. The reason is that Gtk requires compilation, and not everyone has a compiler installed; with this design, they won't even be able to use the package with ProfileViewSVG because it will error when they issue using ProfileView
.
If you changed this because you couldn't get it working, what was the error?
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'm certain there's a better solution, but I neither managed to understand the subtleties of how the code used to work nor more exactly why it was failing. Without the last commit the error is:
ERROR: LoadError: LoadError: UndefVarError: ProfileViewGtk not defined
Stacktrace:
[1] #view#23(::Bool, ::Nothing, ::Bool, ::Int64, ::Bool, ::Array{Any,1}, ::Function, ::Array{UInt64,1}) at /tmp/ProfileView.jl/src/ProfileView.jl:54
[2] view at /tmp/ProfileView.jl/src/ProfileView.jl:54 [inlined] (repeats 2 times)
[3] top-level scope at none:0
[4] include at ./boot.jl:317 [inlined]
[5] include_relative(::Module, ::String) at ./loading.jl:1038
[6] include(::Module, ::String) at ./sysimg.jl:29
[7] include(::String) at ./client.jl:398
[8] top-level scope at none:0
[9] include at ./boot.jl:317 [inlined]
[10] include_relative(::Module, ::String) at ./loading.jl:1038
[11] include(::Module, ::String) at ./sysimg.jl:29
[12] include(::String) at ./client.jl:398
[13] top-level scope at none:0
in expression starting at /tmp/ProfileView.jl/test/test.jl:40
in expression starting at /tmp/ProfileView.jl/test/runtests.jl:6
src/tree.jl
Outdated
data::T | ||
parent::Node{T} | ||
child::Node{T} | ||
sibling::Node{T} | ||
|
||
# Constructor for the root of the tree | ||
function (::Type{Node{T}}){T}(data::T) | ||
function (::Type{Node{T}})(data::T) where T |
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.
These can change to the newer and much easier syntax, function Node{T})(data) where T
.
src/tree.jl
Outdated
Node{T}(data::T) = Node{T}(data) | ||
Node{T}(data::T, parent::Node{T}) = Node{T}(data, parent) | ||
Node(data::T) where {T} = Node{T}(data) | ||
Node(data::T, parent::Node{T}) where {T} = Node{T}(data, parent) |
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.
Now that I know more I'd write this as Node(data, parent::Node{T}) where T
(dropping the ::T
on data
). Having the parent is enough to specify the T
we need, and any data
that can be converted to T
will then work.
Completely optional, however.
src/tree.jl
Outdated
@@ -50,7 +50,7 @@ function lastsibling(sib::Node) | |||
sib | |||
end | |||
|
|||
function addsibling{T}(oldersib::Node{T}, data::T) | |||
function addsibling(oldersib::Node{T}, data::T) where T |
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.
likewise here
src/tree.jl
Outdated
n = new{T}(data) | ||
n.parent = n | ||
n.child = n | ||
n.sibling = n | ||
n | ||
end | ||
# Constructor for all others | ||
function (::Type{Node{T}}){T}(data::T, parent::Node) | ||
function (::Type{Node{T}})(data::T, parent::Node) where T |
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.
here too
test/test.jl
Outdated
@@ -4,10 +4,10 @@ function profile_test(n) | |||
for i = 1:n | |||
A = randn(100,100,20) | |||
m = maximum(A) | |||
Afft = fft(A) | |||
Am = mapslices(sum, A, 2) | |||
# Afft = fft(A) |
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.
Agreed better not to use fft
. You can either replace it or skip it, either is fine with me.
…move commented out fft call during testing.
Review comments have been addressed except for the conditional loading, which is beyond my grasp for now. At this point I'm getting massive amounts of warnings from GtkReactive. It would help if JuliaGizmos/GtkReactive.jl#69 could be merged. |
This reverts commit f67b9c1.
Reverted the conditional loading fix since it was buggy (had forgot to remove the The loading issues still need to be fixed though. |
Some progress. The immediate problem wasn't about changes to the code loading logic but that the
wasn't actually doing anything (at least not visible) and should instead have been
But as far as I can tell that's equivalent to
and
so I'll assume the explicit construction of the |
At this point the SVG backend might be functional. The GTK backend is blocked by GtkReactive. |
I don't have the bandwidth to look at this now. After the Interpolations rewrite is done and I get Rebugger announced, maybe I'll have time. Till then, sorry, and good luck! |
Closing in slowly. With JuliaGizmos/GtkReactive.jl#72 I get ProfileView to pass its tests on 0.7, although there are still some warnings. And well, it doesn't actually work. It manages to draw the blocks but is somewhat less than useful without the annotations. The main remaining warning is
Apparently the package manager (or maybe more accurate the code loader) is not impressed by the LOAD_PATH trickery for optional dependencies, so some improvement is needed on that front. |
Yes, we might have to split it out as a separate package. Or perhaps we can add a |
Integrated into #99 |
Let's get ProfileView working in Julia 0.7 and 1.0. This PR is so far incomplete and fixes the more straightforward deprecations.