From 951c5bf0ebc149c42465d37baee0189a84278c73 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 10 Oct 2019 09:30:59 -0500 Subject: [PATCH] Update Project.toml and using's for registration (#263) * Update Project.toml and using's for registration * Bump JuMP version --- .travis.yml | 2 +- Project.toml | 8 +++----- docs/Project.toml | 2 -- src/SDDP.jl | 9 ++++++++- src/plugins/integrality_handlers.jl | 8 +++----- test/algorithm.jl | 4 +++- test/deterministic_equivalent.jl | 4 +++- test/plugins/backward_sampling_schemes.jl | 3 ++- test/plugins/bellman_functions.jl | 4 +++- test/plugins/integrality_handlers.jl | 6 ++++-- test/plugins/risk_measures.jl | 6 +++--- test/plugins/sampling_schemes.jl | 3 ++- test/plugins/stopping_rules.jl | 5 ++++- test/runtests.jl | 4 +++- test/user_interface.jl | 4 +++- test/visualization.jl | 3 ++- 16 files changed, 47 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c69a1f8d..c024a87fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,5 +14,5 @@ jobs: julia: 1.0 os: linux script: - - julia --project=docs -e 'using Pkg; Pkg.instantiate(); Pkg.add(PackageSpec(path=pwd()))' + - julia --project=docs -e 'using Pkg; Pkg.add(PackageSpec(path=pwd()))' - julia --project=docs --color=yes docs/make.jl diff --git a/Project.toml b/Project.toml index d34f10a92..13e422e7f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,16 +1,13 @@ name = "SDDP" uuid = "f4570300-c277-11e8-125c-4912f86ce65d" authors = ["Oscar Dowson = f_actual + dot(subgradients, x - dual_vars)) + JuMP.@constraint(approx_model, θ >= f_actual + LinearAlgebra.dot(subgradients, x - dual_vars)) if f_actual <= best_actual best_actual = f_actual best_mult .= dual_vars end else - JuMP.@constraint(approx_model, θ <= f_actual + dot(subgradients, x - dual_vars)) + JuMP.@constraint(approx_model, θ <= f_actual + LinearAlgebra.dot(subgradients, x - dual_vars)) if f_actual >= best_actual best_actual = f_actual best_mult .= dual_vars diff --git a/test/algorithm.jl b/test/algorithm.jl index e25141adf..4710bd058 100644 --- a/test/algorithm.jl +++ b/test/algorithm.jl @@ -3,7 +3,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test, GLPK +using GLPK +using SDDP +using Test @testset "Forward Pass" begin model = SDDP.PolicyGraph(SDDP.LinearGraph(2); diff --git a/test/deterministic_equivalent.jl b/test/deterministic_equivalent.jl index 5c36e415b..38a96b5db 100644 --- a/test/deterministic_equivalent.jl +++ b/test/deterministic_equivalent.jl @@ -3,7 +3,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test, GLPK +using GLPK +using SDDP +using Test @testset "cyclic checks" begin @testset "Acyclic linear" begin diff --git a/test/plugins/backward_sampling_schemes.jl b/test/plugins/backward_sampling_schemes.jl index 402ccbfbb..71c33e9fe 100644 --- a/test/plugins/backward_sampling_schemes.jl +++ b/test/plugins/backward_sampling_schemes.jl @@ -3,7 +3,8 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test +using SDDP +using Test @testset "CompleteSampler" begin model = SDDP.LinearPolicyGraph( diff --git a/test/plugins/bellman_functions.jl b/test/plugins/bellman_functions.jl index 3c3d2540a..a84d15bf9 100644 --- a/test/plugins/bellman_functions.jl +++ b/test/plugins/bellman_functions.jl @@ -3,7 +3,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test, GLPK +using GLPK +using SDDP +using Test @testset "Read/write cuts to file" begin function create_model(graph) diff --git a/test/plugins/integrality_handlers.jl b/test/plugins/integrality_handlers.jl index 2e14e7a5f..7b1ccc612 100644 --- a/test/plugins/integrality_handlers.jl +++ b/test/plugins/integrality_handlers.jl @@ -3,7 +3,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, JuMP, GLPK, Test +using GLPK +using SDDP +using Test @testset "get_dual_variables" begin # Single-stage model helps set up a node and subproblem to test dual @@ -30,7 +32,7 @@ using SDDP, JuMP, GLPK, Test if integrality_handler == SDDP.ContinuousRelaxation() SDDP.relax_integrality(model, integrality_handler) end - JuMP.optimize!(node.subproblem) + optimize!(node.subproblem) dual_vars = SDDP.get_dual_variables(node, integrality_handler) if integrality_handler == SDDP.ContinuousRelaxation() diff --git a/test/plugins/risk_measures.jl b/test/plugins/risk_measures.jl index 2ca184bc7..f57830ac7 100644 --- a/test/plugins/risk_measures.jl +++ b/test/plugins/risk_measures.jl @@ -3,9 +3,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test - -using GLPK # Required for Wasserstein. +using GLPK +using SDDP +using Test @testset "Expectation" begin @test sprint(show, SDDP.Expectation()) == "SDDP.Expectation()" diff --git a/test/plugins/sampling_schemes.jl b/test/plugins/sampling_schemes.jl index 1aeecd3a6..03abc4c7c 100644 --- a/test/plugins/sampling_schemes.jl +++ b/test/plugins/sampling_schemes.jl @@ -3,7 +3,8 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test +using SDDP +using Test @testset "InSampleMonteCarlo" begin @testset "Acyclic" begin diff --git a/test/plugins/stopping_rules.jl b/test/plugins/stopping_rules.jl index 890f07d2a..1ed9b4c7b 100644 --- a/test/plugins/stopping_rules.jl +++ b/test/plugins/stopping_rules.jl @@ -3,7 +3,10 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, GLPK, Random, Test +using GLPK +using Random +using SDDP +using Test @testset "TimeLimit" begin graph = SDDP.PolicyGraph(SDDP.LinearGraph(2), diff --git a/test/runtests.jl b/test/runtests.jl index 9030231bc..db46515a6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test, Random +using Random +using SDDP +using Test function read_dir(dir, exclude = String[]) return filter(s->!(s in exclude) && endswith(s, ".jl"), readdir(dir)) diff --git a/test/user_interface.jl b/test/user_interface.jl index e0a457817..a27ae060d 100644 --- a/test/user_interface.jl +++ b/test/user_interface.jl @@ -3,7 +3,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test, GLPK +using GLPK +using SDDP +using Test @testset "Basic Graphs" begin @testset "LinearGraph" begin diff --git a/test/visualization.jl b/test/visualization.jl index d2260b56c..7a6753c80 100644 --- a/test/visualization.jl +++ b/test/visualization.jl @@ -3,7 +3,8 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -using SDDP, Test +using SDDP +using Test @testset "SpaghettiPlot" begin simulations = [