From 79917cced04f70160396cde33edffa4e3fa60e01 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 13 Nov 2023 17:01:58 +1300 Subject: [PATCH] Use import MathOptInterface as MOI syntax (#287) --- src/MOI_wrapper/MOI_wrapper.jl | 2 -- src/SCS.jl | 2 +- test/MOI_wrapper.jl | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/MOI_wrapper/MOI_wrapper.jl b/src/MOI_wrapper/MOI_wrapper.jl index d50d8aa..27382d5 100644 --- a/src/MOI_wrapper/MOI_wrapper.jl +++ b/src/MOI_wrapper/MOI_wrapper.jl @@ -3,8 +3,6 @@ # Use of this source code is governed by an MIT-style license that can be found # in the LICENSE.md file or at https://opensource.org/licenses/MIT. -const MOI = MathOptInterface - include("scaled_psd_cone_bridge.jl") MOI.Utilities.@product_of_sets( diff --git a/src/SCS.jl b/src/SCS.jl index 89a7ed5..5151480 100644 --- a/src/SCS.jl +++ b/src/SCS.jl @@ -5,7 +5,7 @@ module SCS -import MathOptInterface +import MathOptInterface as MOI import Requires import SCS_jll import SparseArrays diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index f77ebd1..92e985d 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -6,11 +6,9 @@ module TestSCS using Test -using MathOptInterface +import MathOptInterface as MOI import SCS -const MOI = MathOptInterface - function runtests() for name in names(@__MODULE__; all = true) if startswith("$(name)", "test_") @@ -96,6 +94,7 @@ function test_RawOptimizerAttribute() MOI.set(model, MOI.RawOptimizerAttribute("eps_abs"), 2.0) @test MOI.get(model, MOI.RawOptimizerAttribute("eps_abs")) == 2.0 @test MOI.get(model, MOI.RawOptimizerAttribute("eps_abs")) == 2.0 + return end function test_constrained_variables() @@ -142,6 +141,7 @@ function test_unsupported() MOI.set(model, MOI.Test.UnknownConstraintAttribute(), c, 1.0) err = MOI.UnsupportedAttribute{MOI.Test.UnknownConstraintAttribute} @test_throws err MOI.optimize!(optimizer, model) + return end function test_empty_problem()