From 466e6192009f8aeb1dd1950a8d7202c26e38ad20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Tue, 23 Jul 2024 09:43:15 -0400 Subject: [PATCH 1/2] Fix for constraint with unit coefficients --- src/macros.jl | 10 +++++----- src/macros/@constraint.jl | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/macros.jl b/src/macros.jl index 209c3ed3f41..c921525e123 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -300,11 +300,11 @@ Therefore, the result of [`build_constraint`](@ref) is converted in a call to """ model_convert(::AbstractModel, rhs::Any) = rhs -function model_convert(model::AbstractModel, set::MOI.AbstractScalarSet) - if MOI.Utilities.supports_shift_constant(typeof(set)) - T = value_type(typeof(model)) - return MOI.Utilities.shift_constant(set, zero(T)) - end +function model_convert(::AbstractModel, set::MOI.AbstractScalarSet) + #if MOI.Utilities.supports_shift_constant(typeof(set)) + # T = value_type(typeof(model)) + # return MOI.Utilities.shift_constant(set, zero(T)) + #end return set end diff --git a/src/macros/@constraint.jl b/src/macros/@constraint.jl index 9789971cbe6..d4e8a0acf82 100644 --- a/src/macros/@constraint.jl +++ b/src/macros/@constraint.jl @@ -825,7 +825,7 @@ function build_constraint( end function build_constraint(error_fn::Function, f, set::Zeros, args...; kwargs...) - return build_constraint(error_fn, f, MOI.EqualTo(false), args...; kwargs...) + return build_constraint(error_fn, f, MOI.EqualTo(_MA.Zero()), args...; kwargs...) end function build_constraint( From d137bed22a9e1353ef9e7de50a4bc807bb2d109c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Tue, 23 Jul 2024 10:09:21 -0400 Subject: [PATCH 2/2] Use MA branch --- .github/workflows/ci.yml | 7 +++++++ .github/workflows/documentation.yml | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3430f71379..ae7dac89fba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,13 @@ jobs: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v1 + - name: MOI + shell: julia --project=@. {0} + run: | + using Pkg + Pkg.add([ + PackageSpec(name="MutableArithmetics", rev="bl/zero_number"), + ]) - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 with: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e8e1145d4b1..0a9464ca184 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -19,7 +19,10 @@ jobs: shell: julia --color=yes --project=docs/ {0} run: | using Pkg - Pkg.develop(PackageSpec(path=pwd())) + Pkg.add([ + PackageSpec(name="MutableArithmetics", rev="bl/zero_number"), + PackageSpec(path=pwd()), + ]) Pkg.instantiate() - name: Build and deploy env: