Skip to content

Commit b2590fd

Browse files
authored
Add warning for removed all_permutations (#65)
1 parent f8c5071 commit b2590fd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/algorithms/Lexicographic.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ mutable struct Lexicographic <: AbstractAlgorithm
2424
rtol::Vector{Float64}
2525
all_permutations::Bool
2626

27-
function Lexicographic()
27+
function Lexicographic(; all_permutations::Union{Nothing,Bool} = nothing)
28+
if all_permutations !== nothing
29+
@warn(
30+
"The `all_permutations` argument to `Lexicographic` was " *
31+
"removed in v1.0. Set the `MOA.LexicographicAllPermutations()` " *
32+
"option to `$all_permutations` instead.",
33+
)
34+
end
2835
return new(Float64[], default(LexicographicAllPermutations()))
2936
end
3037
end

test/algorithms/Lexicographic.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ function test_vector_of_variables_objective()
167167
return
168168
end
169169

170+
function test_warn_all_permutations()
171+
@test_logs (:warn,) MOA.Lexicographic(; all_permutations = true)
172+
@test_logs (:warn,) MOA.Lexicographic(; all_permutations = false)
173+
@test_logs MOA.Lexicographic()
174+
return
175+
end
176+
170177
end
171178

172179
TestLexicographic.run_tests()

0 commit comments

Comments
 (0)