From be7e2c3aea77c914b490bcb49938834a0c22b3f2 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 21:24:05 +0200 Subject: [PATCH 01/17] add plot test that already works --- test/unit_plot.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit_plot.jl b/test/unit_plot.jl index c8d5c3c4de..bc1f848865 100644 --- a/test/unit_plot.jl +++ b/test/unit_plot.jl @@ -104,7 +104,7 @@ for N in [Float64, Rational{Int}, Float32] plot(hpgo, ε) plot(hpt, ε) plot(vpg, ε) - @test_throws AssertionError plot(vpt, ε) # TODO see #574 + plot(vpt, ε) @test_throws AssertionError plot(es, ε) # TODO see #577 @test_throws ErrorException plot(hs, ε) # TODO see #576/#578 @test_throws ErrorException plot(hp, ε) # TODO see #576/#578 From dff22a38da160f1098458445f5a26542bea0bb84 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 21:38:45 +0200 Subject: [PATCH 02/17] move polytope tests (only work with Float64) --- test/unit_Polytope.jl | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/unit_Polytope.jl b/test/unit_Polytope.jl index ff10bbb6f8..b1889c019c 100644 --- a/test/unit_Polytope.jl +++ b/test/unit_Polytope.jl @@ -76,15 +76,6 @@ for N in [Float64, Rational{Int}, Float32] # dim @test dim(p) == 2 - # support vector (only available with Polyhedra library) - d = N[1, 0] - @test_throws ErrorException σ(d, p, algorithm="xyz") - if test_suite_polyhedra - @test σ(d, p) == N[1.0, 0.0] - else - @test_throws AssertionError σ(d, p) - end - # vertices_list function @test vertices_list(p) == p.vertices @@ -156,6 +147,17 @@ if test_suite_polyhedra # V-rep # ----- + # support vector (only available with Polyhedra library) + polygon = VPolygon([N[0, 0], N[1, 0], N[0, 1]]) + p = VPolytope(polygon) + d = N[1, 0] + @test_throws ErrorException σ(d, p, algorithm="xyz") + if test_suite_polyhedra + @test σ(d, p) == N[1, 0] + else + @test_throws AssertionError σ(d, p) + end + # intersection p1 = VPolytope(vertices_list(BallInf(N[0, 0], N(1)))) p2 = VPolytope(vertices_list(BallInf(N[2, 2], N(1)))) From 49f0f780eae062262539627fb9617d88774983a5 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 21:39:11 +0200 Subject: [PATCH 03/17] avoid variable redefinition --- src/VPolytope.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/VPolytope.jl b/src/VPolytope.jl index e8b957d448..cf570ee6db 100644 --- a/src/VPolytope.jl +++ b/src/VPolytope.jl @@ -225,8 +225,7 @@ in vertex representation. """ function tohrep(P::VPolytope{N}; backend=default_polyhedra_backend(N)) where {N} - P = polyhedron(P, backend) - return HPolytope(P) + return HPolytope(polyhedron(P, backend)) end """ From cf3d9840fcfe372e9f28d91a7e20ada349c69617 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 21:46:27 +0200 Subject: [PATCH 04/17] remove failing unit test ('empty' HPolytope is not empty) --- test/unit_Polytope.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/test/unit_Polytope.jl b/test/unit_Polytope.jl index b1889c019c..b53dd67f3b 100644 --- a/test/unit_Polytope.jl +++ b/test/unit_Polytope.jl @@ -96,7 +96,6 @@ if test_suite_polyhedra # check isempty function of the AbstractPolytope interface @test isempty(empty_H_polytope) @test isempty(empty_V_polytope) - is_intersection_empty(empty_H_polytope, empty_V_polytope) end # Polyhedra tests that only work with Float64 From 825e0ba6cdf5becf467cfb37c5289180e606f32a Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 21:57:37 +0200 Subject: [PATCH 05/17] fix test argument (vector -> vector of vectors) --- test/unit_Polytope.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit_Polytope.jl b/test/unit_Polytope.jl index b53dd67f3b..c87a0dbcaa 100644 --- a/test/unit_Polytope.jl +++ b/test/unit_Polytope.jl @@ -133,7 +133,7 @@ if test_suite_polyhedra b = N[1, 0] p = HPolytope(A, b) vl = vertices_list(p) - @test ispermutation(vl, N[0, 1]) + @test ispermutation(vl, [N[0], N[1]]) # tovrep from HPolytope A = [N(0) N(-1); N(-1) N(0); N(1) N(1)] From 783323133f40b6e16db2fc4681707e64f9f0ed8d Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 22:06:29 +0200 Subject: [PATCH 06/17] load Polyhedra for plot tests --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 3956470499..1096103039 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,7 +35,7 @@ else error("unknown parameter 1: $(ARGS[1])") end -if test_suite_polyhedra +if test_suite_polyhedra || test_suite_plotting using Polyhedra # fix namespace conflicts with Polyhedra From 13011ed63c210b4d88303621c1367586091bac31 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 22:23:38 +0200 Subject: [PATCH 07/17] fix 'missing docstrings' --- docs/src/lib/interfaces.md | 2 +- docs/src/lib/methods_fix.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/lib/interfaces.md b/docs/src/lib/interfaces.md index 6f5ac78630..c9aaec3e41 100644 --- a/docs/src/lib/interfaces.md +++ b/docs/src/lib/interfaces.md @@ -45,7 +45,7 @@ Every `LazySet` type must define a function `σ` to compute the support vector. ```@docs support_vector -ρ(::AbstractVector{Real}, ::LazySet{Real}) +ρ(::AbstractVector{N}, ::LazySet{N}) where {N<:Real} support_function ``` diff --git a/docs/src/lib/methods_fix.md b/docs/src/lib/methods_fix.md index 3153f49967..3ab2f88b8a 100644 --- a/docs/src/lib/methods_fix.md +++ b/docs/src/lib/methods_fix.md @@ -35,6 +35,7 @@ vertices_list + <= σ +ρ ∈ ⊆ ``` From 95be242b8161e87d7b99b0a57f4f5264e06bba10 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 22:41:16 +0200 Subject: [PATCH 08/17] activate missing unit tests in v0.6 --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 1096103039..fb891b0951 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -13,8 +13,8 @@ import LazySets.ispermutation global test_suite_basic = true global test_suite_doctests = VERSION >= v"0.7-" # only run doctests with new Julia version -global test_suite_polyhedra = false -global test_suite_plotting = false +global test_suite_polyhedra = VERSION < v"0.7-" # only run doctests with old Julia version (for now) +global test_suite_plotting = VERSION < v"0.7-" # only run doctests with old Julia version (for now) if (length(ARGS) == 0) || (ARGS[1] == "--default") # default test suite including doctests From 7ec283d4a78dbb0d23ab86999c19eea42557e019 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 30 Sep 2018 23:06:18 +0200 Subject: [PATCH 09/17] install Polyhedra in v0.6 unit tests --- test/runtests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/runtests.jl b/test/runtests.jl index fb891b0951..981591e26a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -36,6 +36,7 @@ else end if test_suite_polyhedra || test_suite_plotting + VERSION < v"0.7-" && Pkg.add("Polyhedra") using Polyhedra # fix namespace conflicts with Polyhedra From 05c0ba114330dc509e5b5ea0f832c7dac5beb795 Mon Sep 17 00:00:00 2001 From: mforets Date: Sun, 30 Sep 2018 19:15:30 -0300 Subject: [PATCH 10/17] fix docstring --- src/AbstractPolytope.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AbstractPolytope.jl b/src/AbstractPolytope.jl index 8559b8973d..04d827eeee 100644 --- a/src/AbstractPolytope.jl +++ b/src/AbstractPolytope.jl @@ -37,7 +37,7 @@ abstract type AbstractPolytope{N<:Real} <: LazySet{N} end """ singleton_list(P::AbstractPolytope{N})::Vector{Singleton{N}} where {N<:Real} -Return the vertices of a polytopic as a list of singletons. +Return the vertices of a polytopic set as a list of singletons. ### Input From 8a1777a2cf15d5cbfebb6dab70b94e131975464c Mon Sep 17 00:00:00 2001 From: mforets Date: Sun, 30 Sep 2018 19:21:00 -0300 Subject: [PATCH 11/17] update REQUIRE --- test/REQUIRE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/REQUIRE b/test/REQUIRE index 8b8bdc32fc..8e0c743b5c 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -6,4 +6,6 @@ IntervalArithmetic 0.14 MathProgBase 0.7 RecipesBase 0.3 Requires 0.4 -Optim 0.14.1 \ No newline at end of file +Optim 0.14.1 +Polyhedra 0.3.4 +CDDLib 0.3.2 From a3fa8e4607a5c4d7bb5ded7ffef01940f8d0f864 Mon Sep 17 00:00:00 2001 From: mforets Date: Sun, 30 Sep 2018 19:44:44 -0300 Subject: [PATCH 12/17] add CDDLib --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 981591e26a..74fb1e9631 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -36,7 +36,7 @@ else end if test_suite_polyhedra || test_suite_plotting - VERSION < v"0.7-" && Pkg.add("Polyhedra") + VERSION < v"0.7-" && Pkg.add("Polyhedra") && Pkg.add("CDDLib") using Polyhedra # fix namespace conflicts with Polyhedra From 7acabcb668d12cbe40454d9a930d573dc60b4a2b Mon Sep 17 00:00:00 2001 From: mforets Date: Sun, 30 Sep 2018 20:27:31 -0300 Subject: [PATCH 13/17] fix && --- test/runtests.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 74fb1e9631..bdd23e7d8b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -36,7 +36,9 @@ else end if test_suite_polyhedra || test_suite_plotting - VERSION < v"0.7-" && Pkg.add("Polyhedra") && Pkg.add("CDDLib") + if VERSION < v"0.7-" + Pkg.add("Polyhedra"); Pkg.add("CDDLib") + end using Polyhedra # fix namespace conflicts with Polyhedra From 238ce7c948b2d781824867e410d01d3c00f9c90f Mon Sep 17 00:00:00 2001 From: mforets Date: Sun, 30 Sep 2018 21:48:18 -0300 Subject: [PATCH 14/17] add Optim to tests clause --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index bdd23e7d8b..fbfe5c59f6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,7 +37,7 @@ end if test_suite_polyhedra || test_suite_plotting if VERSION < v"0.7-" - Pkg.add("Polyhedra"); Pkg.add("CDDLib") + Pkg.add("Polyhedra"); Pkg.add("CDDLib"); Pkg.add("Optim") end using Polyhedra From 7ff8d1d484d73a32c5c69c0e68702f043204c58c Mon Sep 17 00:00:00 2001 From: mforets Date: Sun, 30 Sep 2018 22:06:29 -0300 Subject: [PATCH 15/17] add Plott to test_suite_plotting < 0.7| --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index fbfe5c59f6..e1e19a03c9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,7 +37,7 @@ end if test_suite_polyhedra || test_suite_plotting if VERSION < v"0.7-" - Pkg.add("Polyhedra"); Pkg.add("CDDLib"); Pkg.add("Optim") + Pkg.add("Polyhedra"); Pkg.add("CDDLib"); Pkg.add("Optim"); Pkg.add("Plots") end using Polyhedra From 6c5bb61483f3246bdd88cc198d5b5e277d2855e0 Mon Sep 17 00:00:00 2001 From: mforets Date: Sun, 30 Sep 2018 23:10:58 -0300 Subject: [PATCH 16/17] teomp build failure in 1.0 (dependencies) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9cf4c3fe9a..905165be4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ git: ## allow failures (tests will run but not make your overall status red) matrix: allow_failures: + - julia: 1.0 - julia: nightly ## uncomment and modify the following lines to manually install system packages From 981e5f94253518ec493932c1aac32fae25468b96 Mon Sep 17 00:00:00 2001 From: schillic Date: Mon, 1 Oct 2018 08:35:56 +0200 Subject: [PATCH 17/17] remove packages from test/REQUIRE (for build in v1.0) --- .travis.yml | 1 - test/REQUIRE | 2 -- 2 files changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 905165be4c..9cf4c3fe9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ git: ## allow failures (tests will run but not make your overall status red) matrix: allow_failures: - - julia: 1.0 - julia: nightly ## uncomment and modify the following lines to manually install system packages diff --git a/test/REQUIRE b/test/REQUIRE index 8e0c743b5c..2fbbd05443 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -7,5 +7,3 @@ MathProgBase 0.7 RecipesBase 0.3 Requires 0.4 Optim 0.14.1 -Polyhedra 0.3.4 -CDDLib 0.3.2