From c21bedc15bce0537a61ff95f6020d404d8bfacd3 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 13 Jan 2025 16:33:57 +1300 Subject: [PATCH] Remove warning from operator_warn (#3911) --- src/operators.jl | 12 ------------ test/test_operator.jl | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/operators.jl b/src/operators.jl index 18a6600ede4..5141a959c93 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -278,18 +278,6 @@ operator_warn(::AbstractModel) = nothing function operator_warn(model::GenericModel) model.operator_counter += 1 - if model.operator_counter > 20000 - @warn( - "The addition operator has been used on JuMP expressions a large " * - "number of times. This warning is safe to ignore but may " * - "indicate that model generation is slower than necessary. For " * - "performance reasons, you should not add expressions in a loop. " * - "Instead of x += y, use add_to_expression!(x,y) to modify x in " * - "place. If y is a single variable, you may also use " * - "add_to_expression!(x, coef, y) for x += coef*y.", - maxlog = 1 - ) - end return end diff --git a/test/test_operator.jl b/test/test_operator.jl index 718558aed27..fd1b5d95cbb 100644 --- a/test/test_operator.jl +++ b/test/test_operator.jl @@ -270,7 +270,7 @@ function test_extension_operator_warn( # Triggers the increment of operator_counter since lhs has more than # 50 terms if i == 20_001 && ModelType <: Model - @test_logs (:warn,) lhs + rhs + @test_nowarn lhs + rhs else lhs + rhs end