Skip to content

Commit 526951c

Browse files
committed
require Julia v1.10
1 parent 10eaeb5 commit 526951c

File tree

11 files changed

+13
-66
lines changed

11 files changed

+13
-66
lines changed

.github/workflows/test-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
arch:
2626
- x64
2727
include:
28-
- version: '1.6' # test on oldest supported version
28+
- version: '1.10' # test on oldest supported version
2929
arch: x64
3030
os: ubuntu-latest
3131
env:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ Requires = "0.5, 1"
3333
SharedArrays = "<0.0.1, 1.6"
3434
SparseArrays = "<0.0.1, 1.6"
3535
StaticArraysCore = "1"
36-
julia = "1.6"
36+
julia = "1.10"

src/Approximations/overapproximate_zonotope.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,12 +1167,7 @@ function _overapproximate_zonotope_hyperplane(Z::AbstractZonotope, H::Hyperplane
11671167

11681168
s = G' * a
11691169
d = b - dot(a, c)
1170-
@static if VERSION >= v"1.7"
1171-
sT = s'
1172-
else
1173-
sT = s' .+ 0 # convert to Vector (`nullspace` fails for lazy transpose)
1174-
end
1175-
V0 = nullspace(sT)
1170+
V0 = nullspace(s')
11761171

11771172
cs = s * d / dot(s, s)
11781173
Gs = V0 * V0'
@@ -1257,8 +1252,8 @@ function load_overapproximate_ICP()
12571252
ICP.Separator($e, $vars)
12581253
end)
12591254
# smallest box containing all points in domain X satisfying constraint
1260-
# (`invokelatest` to avoid world-age issue; `Base.` for VERSION < v"1.9")
1261-
boundary, _, _ = Base.invokelatest(separator, IB.IntervalBox(X...))
1255+
# (`invokelatest` to avoid world-age issue)
1256+
boundary, _, _ = invokelatest(separator, IB.IntervalBox(X...))
12621257
return boundary
12631258
end
12641259
end

src/Initialization/init_Symbolics.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ _vec(vars::Vector{Symbolics.Arr{Num,1}}) = reduce(vcat, vars)
77
_vec(vars::Vector{Vector{Num}}) = reduce(vcat, vars)
88
_vec(vars::Vector{Real}) = reduce(vcat, vars)
99

10-
# `sort` argument was introduced in Symbolics v6.1
11-
@static if VERSION < v"1.10"
12-
_get_variables(expr::Num) = convert(Vector{Num}, Symbolics.get_variables(expr))
13-
else
14-
_get_variables(expr::Num) = convert(Vector{Num}, Symbolics.get_variables(expr; sort=true))
15-
end
10+
_get_variables(expr::Num) = convert(Vector{Num}, Symbolics.get_variables(expr; sort=true))
1611
function _get_variables(expr::Vector{<:Num})
1712
return unique(reduce(vcat, _get_variables(ex) for ex in expr))
1813
end

src/Interfaces/AbstractZonotope.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,7 @@ end
635635

636636
function flat_dimensions(Z::AbstractZonotope)
637637
G = genmat(Z)
638-
@static if VERSION >= v"1.7"
639-
res = findall(iszero, eachrow(G))
640-
else
641-
res = findall(iszero, collect(eachrow(G)))
642-
end
638+
res = findall(iszero, eachrow(G))
643639
return res
644640
end
645641

@@ -853,9 +849,6 @@ function remove_redundant_generators(G::AbstractMatrix)
853849

854850
# sort column in ascending order
855851
cols = eachcol(Gnorm)
856-
if VERSION < v"1.9"
857-
cols = collect(cols)
858-
end
859852
ord = sortperm(cols)
860853
merged = Vector{Vector{eltype(G)}}()
861854

src/LazySets.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ import IntervalArithmetic as IA
3333
using LinearAlgebra: checksquare
3434
using Random: AbstractRNG, GLOBAL_RNG, SamplerType, randperm
3535

36-
@static if VERSION < v"1.9"
37-
stack(vecs) = hcat(vecs...) # COV_EXCL_LINE
38-
end
39-
4036
# ================
4137
# ReachabilityBase
4238
# ================

src/Utils/helper_functions.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,7 @@ _to_colVector(M::AbstractMatrix) = convert(Vector, [M[:, j] for j in axes(M, 2)]
272272
_to_colVector(M::Matrix) = [M[:, j] for j in axes(M, 2)]
273273

274274
function load_StaticArraysCore_to_colVector()
275-
@static if VERSION < v"1.9"
276-
# in pre-v1.9 Julia versions, `collect` returned a `SizedVector`
277-
return quote
278-
_to_colVector(M::SMatrix) = [eachcol(M)...]
279-
end
280-
else
281-
return quote
282-
_to_colVector(M::SMatrix) = collect(eachcol(M))
283-
end
275+
return quote
276+
_to_colVector(M::SMatrix) = collect(eachcol(M))
284277
end
285278
end # load_StaticArraysCore_to_colVector()

test/LazyOperations/Intersection.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
using LazySets, Test
22
using LazySets.ReachabilityBase.Arrays: SingleEntryVector, ispermutation
3-
@static if VERSION >= v"1.9"
4-
vGLPK = pkgversion(LazySets.GLPK)
5-
else
6-
import PkgVersion
7-
vGLPK = PkgVersion.Version(LazySets.GLPK)
8-
end
93
if !isdefined(@__MODULE__, Symbol("@tN"))
104
macro tN(v)
115
return v
@@ -70,7 +64,7 @@ for N in @tN([Float64, Float32, Rational{Int}])
7064
I2 = Hyperplane(ones(N, 2), N(1)) HalfSpace(ones(N, 2), N(1))
7165
# the next test fails with the "EXACT" solver GLPK older than v0.15.3
7266
# see https://github.com/jump-dev/GLPK.jl/issues/207
73-
if N != Rational{Int} || vGLPK >= v"0.15.3"
67+
if N != Rational{Int} || pkgversion(LazySets.GLPK) >= v"0.15.3"
7468
@test !isbounded(I2) && !isboundedtype(typeof(I2))
7569
end
7670

test/Sets/EmptySet.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ for N in @tN([Float64, Float32, Rational{Int}])
177177

178178
# singleton_list
179179
res = singleton_list(E)
180-
T = VERSION < v"1.7" ? Singleton : Singleton{N,Vector{N}}
181-
@test res isa Vector{T} && isempty(res)
180+
@test res isa Vector{Singleton{N,Vector{N}}} && isempty(res)
182181

183182
# tosimplehrep
184183
@test_throws MethodError tosimplehrep(E) # TODO this should maybe change

test/Sets/Interval.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
using LazySets, Test
22
using LazySets.ReachabilityBase.Arrays: ispermutation, SingleEntryVector
33
IA = LazySets.IA
4-
@static if VERSION >= v"1.9"
5-
vIA = pkgversion(IA)
6-
else
7-
import PkgVersion
8-
vIA = PkgVersion.Version(IA)
9-
end
104
if !isdefined(@__MODULE__, Symbol("@tN"))
115
macro tN(v)
126
return v
@@ -350,11 +344,7 @@ for N in @tN([Float64, Float32, Rational{Int}])
350344
@test isidentical(Y, Interval(N(0), N(4)))
351345
Y = linear_map(zeros(N, 1, 1), X) # zero map
352346
@test Y isa Interval{N}
353-
if vIA == v"0.21.0"
354-
@test_broken isequivalent(Y, Interval(N(0), N(0))) # bug in IntervalArithmetic: 0 * I == I
355-
else
356-
@test isequivalent(Y, Interval(N(0), N(0)))
357-
end
347+
@test isequivalent(Y, Interval(N(0), N(0)))
358348
Y = linear_map(ones(N, 2, 1), X) # higher dimension
359349
@test Y isa LazySet{N} && isequivalent(Y, LineSegment(N[0, 0], N[2, 2]))
360350
Y = linear_map(zeros(N, 2, 1), X) # zero map in higher dimension

0 commit comments

Comments
 (0)