From c3b9af5be9ee054bfb8b7ceaca9c31e96d4c3fc4 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Tue, 26 May 2026 14:06:17 +1200 Subject: [PATCH 1/4] Prep for v1.51.1 --- Project.toml | 2 +- docs/src/changelog.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 30a1b75d0e..2ac37e8e95 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "MathOptInterface" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.51.0" +version = "1.51.1" [deps] CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" diff --git a/docs/src/changelog.md b/docs/src/changelog.md index 73ebf8e8f9..428119cf67 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -7,6 +7,18 @@ CurrentModule = MathOptInterface The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v1.51.1 (May 27, 2026) + +### Fixed + +- Fixed basic tests with [`PowerCone`](@ref) (#3003) +- Fixed various getters for [`VariableBridgingCost`](@ref) and + [`ConstraintBridgingCost`](@ref). This release adds new tests, which may cause + the tests of some dependent packages to break because of a common bug in how + layers should compute the costs of bridging variable and constraints. If you + need help fixing a package with broken tests, please open a GitHub issue. + (#3001), (#3004) + ## v1.51.0 (April 27, 2026) ### Breaking From e100a38d70709a0f0ce953c1643dfd8da5e07d84 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Tue, 26 May 2026 14:45:22 +1200 Subject: [PATCH 2/4] Add missing docstrings --- docs/src/reference/models.md | 2 ++ src/attributes.jl | 43 ++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/docs/src/reference/models.md b/docs/src/reference/models.md index 8c8f194bfc..c9cef1e483 100644 --- a/docs/src/reference/models.md +++ b/docs/src/reference/models.md @@ -58,6 +58,8 @@ ListOfConstraintAttributesSet ListOfConstraintsWithAttributeSet UserDefinedFunction ListOfSupportedNonlinearOperators +ConstraintBridgingCost +VariableBridgingCost ``` ## Optimizer interface diff --git a/src/attributes.jl b/src/attributes.jl index b7e35c7373..f671e3d86f 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -3271,7 +3271,27 @@ end attribute_value_type(::DualStatus) = ResultStatusCode -# Cost of bridging constrained variable in S +""" + VariableBridgingCost{S<:AbstractSet}()::Float64 + +An [`AbstractModelAttribute`](@ref) for the cost or bridging a variable in a set +of type `S`. + +## Implementation + +There is a default fallback which returns `0.0` if +[`supports_add_constrained_variable`](@ref) or +[`supports_add_constrained_variables`](@ref) is `true` and `Inf` if `false`. + +Therefore, you should implement this method only if your optimizer does +something unusual. + +Optimizers should implement the following methods: +``` +MOI.get(::Optimizer, ::MOI.VariableBridgingCost{S})::Float64 +``` +They should not implement [`set`](@ref) or [`supports`](@ref). +""" struct VariableBridgingCost{S<:AbstractSet} <: AbstractModelAttribute end attribute_value_type(::VariableBridgingCost) = Float64 @@ -3290,7 +3310,26 @@ function get_fallback( return supports_add_constrained_variables(model, S) ? 0.0 : Inf end -# Cost of bridging F-in-S constraints +""" + ConstraintBridgingCost{F<:AbstractFunction,S<:AbstractSet}()::Float64 + +An [`AbstractModelAttribute`](@ref) for the cost or bridging a constraint of +type `F` in `S`. + +## Implementation + +There is a default fallback which returns `0.0` if [`supports_constraint`](@ref) +is `true` and `Inf` if `false`. + +Therefore, you should implement this method only if your optimizer does +something unusual. + +Optimizers should implement the following methods: +``` +MOI.get(::Optimizer, ::MOI.ConstraintBridgingCost{F,S})::Float64 +``` +They should not implement [`set`](@ref) or [`supports`](@ref). +""" struct ConstraintBridgingCost{F<:AbstractFunction,S<:AbstractSet} <: AbstractModelAttribute end From 667fc077e1d71bda5c53e3107969d97bfd048c01 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 28 May 2026 23:25:32 +1200 Subject: [PATCH 3/4] Apply suggestion from @odow --- docs/src/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/changelog.md b/docs/src/changelog.md index 428119cf67..3363b7e486 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -7,7 +7,7 @@ CurrentModule = MathOptInterface The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v1.51.1 (May 27, 2026) +## v1.51.1 (May 28, 2026) ### Fixed From 5792b01a8ef61dea7d15dd490ea83fcd85bc01d2 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 28 May 2026 23:51:11 +1200 Subject: [PATCH 4/4] Update JuliaFormatter version in format check workflow --- .github/workflows/format_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/format_check.yml b/.github/workflows/format_check.yml index 9ebf405ef1..3e7bbcb24a 100644 --- a/.github/workflows/format_check.yml +++ b/.github/workflows/format_check.yml @@ -18,7 +18,7 @@ jobs: shell: julia --color=yes {0} run: | using Pkg - Pkg.add(PackageSpec(name="JuliaFormatter", version="2")) + Pkg.add(PackageSpec(name="JuliaFormatter", version="2.4.0")) using JuliaFormatter format(".", verbose=true) out = String(read(Cmd(`git diff`)))