Skip to content

Commit

Permalink
Merge pull request #431 from JuliaReach/mforets/dropv6
Browse files Browse the repository at this point in the history
Drop support for julia v0.6
  • Loading branch information
schillic authored Jan 30, 2019
2 parents 6827cd6 + 9488ff9 commit cf1fd85
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 53 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ language: julia
os:
- linux
julia:
- 0.6
- 0.7
- 1.0
- nightly
notifications:
Expand All @@ -19,10 +17,9 @@ matrix:

## uncomment the following lines to override the default test script
script:
- julia -e 'VERSION >= v"0.7-" && using Pkg;
VERSION >= v"0.7-" && Pkg.develop("LazySets");
- julia -e 'using Pkg;
Pkg.develop("LazySets");
Pkg.clone(pwd());
VERSION < v"0.7-" && Pkg.checkout("LazySets");
Pkg.build("Reachability");
Pkg.test("Reachability"; coverage=true)'
after_success:
Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.6
julia 1.0
Compat
Expokit
HybridSystems
Expand Down
33 changes: 13 additions & 20 deletions src/Utils/Utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,19 @@ function add_plot_labels(plot_vars::Vector{Int64};
return labels
end

@static if VERSION >= v"0.7"
# Taken from an older Julia version, see Reachability #414 or
# https://github.com/JuliaLang/julia/blob/788ce677f6043b52caf97323f9de4d6975882561/base/loading.jl#L485
function source_path(default::Union{AbstractString, Nothing}="")
t = current_task()
while true
s = t.storage
if !isa(s, Nothing) && haskey(s, :SOURCE_PATH)
return s[:SOURCE_PATH]
end
if isa(t, t.parent)
return default
end
t = t.parent
# Taken from an older Julia version, see Reachability #414 or
# https://github.com/JuliaLang/julia/blob/788ce677f6043b52caf97323f9de4d6975882561/base/loading.jl#L485
function source_path(default::Union{AbstractString, Nothing}="")
t = current_task()
while true
s = t.storage
if !isa(s, Nothing) && haskey(s, :SOURCE_PATH)
return s[:SOURCE_PATH]
end
if isa(t, t.parent)
return default
end
t = t.parent
end
end

Expand Down Expand Up @@ -316,12 +314,7 @@ then one can do `julia -e 'include("P1/s.jl")'` without having to change `s.jl`.
"""
macro relpath(name::String)
return quote
@static if VERSION < v"0.7"
f = @__FILE__
else
f = source_path()
end

f = source_path()
if f == nothing
pathdir = ""
else
Expand Down
21 changes: 5 additions & 16 deletions src/compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,9 @@ import Compat.LinearAlgebra: norm, checksquare, LAPACKException,
SingularException, ×
import Compat.InteractiveUtils.subtypes

@static if VERSION < v"0.7-"
@inline _At_mul_B(A, B) = At_mul_B(A, B)
@inline _A_mul_B!(C, A, B) = A_mul_B!(C, A, B)
expmat = expm
else
using SparseArrays, Printf
using SparseArrays, Printf
@inline _At_mul_B(A, B) = transpose(A) * B
@inline _A_mul_B!(C, A, B) = mul!(C, A, B)
expmat = exp
export eye

@inline _At_mul_B(A, B) = transpose(A) * B
@inline _A_mul_B!(C, A, B) = mul!(C, A, B)
expmat = exp
end

if VERSION > v"1.0-"
export eye
else
import Compat.LinearAlgebra.eye
end
7 changes: 1 addition & 6 deletions src/logging.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
@static if VERSION < v"1.0-"
import Base: info, warn
end
using Printf

@static if VERSION >= v"0.7"
using Printf
end
import Memento: debug

export info, warn, debug, @timing,
Expand Down
6 changes: 1 addition & 5 deletions test/Reachability/solve_continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
# Test minimal (default) options
# ===============================
using Reachability, MathematicalSystems

# compatibility of julia versions
if VERSION >= v"0.7"
using LinearAlgebra, SparseArrays
end
using LinearAlgebra, SparseArrays

# linear ODE: x' = Ax
A = [ 0.0509836 0.168159 0.95246 0.33644
Expand Down

0 comments on commit cf1fd85

Please sign in to comment.