alan-turing-institute / PDSampler.jl

Piecewise Deterministic Sampler library (Bouncy particle sampler, Zig Zag sampler, ...)
Other
33 stars 8 forks source link

Use Compat library to help with forward looking language #19

Closed tlienart closed 7 years ago

tlienart commented 7 years ago

Language breaking changes: https://github.com/JuliaLang/julia/blob/master/NEWS.md

A few things have already been sorted like abstract Blah to @compat abstract type Blah end etc. A few more things need to be fixed in order for PDMP to be callable by 0.6 and 0.7.

This issue to list what's currently not sorted. (i.e. when include("PDMP.jl") in more advanced Julia fails)

Current error to investigate (with 0.6)

ERROR: LoadError: LoadError: ArgumentError: invalid type for argument pq in method definition for ls_firstbranch! at /Users/tlienart/.julia/v0.5/PDMP/src/local/simulate.jl:157
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:539
 [2] include(::String) at ./sysimg.jl:14
 [3] include_from_node1(::String) at ./loading.jl:539
 [4] include(::String) at ./sysimg.jl:14
while loading /Users/tlienart/.julia/v0.5/PDMP/src/local/simulate.jl, in expression starting on line 517
while loading /Users/tlienart/.julia/v0.5/PDMP/src/PDMP.jl, in expression starting on line 46
tlienart commented 7 years ago

So this runs perfectly well with Julia 0.5* and for some reason 0.6 does not like it

tlienart commented 7 years ago

Ok so the inclusion of every file in PDMP.jl works apart from the very last line include("local/simulate.jl") due to problem mentioned above.

tlienart commented 7 years ago

Ok so it seems the problem was that PriorityQueue has been moved out of Base.Collections to DataStructures as per https://github.com/JuliaLang/julia/pull/19800 ...

I can now include PDMP.jl in Julia 0.6 and Julia 0.7 (albeit with loads of deprecation warnings of types vs immutable struct which are not even catered for by Compat.

tlienart commented 7 years ago

5af6eed

tlienart commented 7 years ago

8f541a9 done