From bb2e89cb1c160cb5797b0cd8d0ac628af31100ba Mon Sep 17 00:00:00 2001 From: "St. Elmo Wilken" Date: Sat, 16 Dec 2023 14:48:05 +0100 Subject: [PATCH 1/3] let variables take sets as well as vectors for convenience --- src/constraint_tree.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constraint_tree.jl b/src/constraint_tree.jl index f5b4830..0545d08 100644 --- a/src/constraint_tree.jl +++ b/src/constraint_tree.jl @@ -191,7 +191,7 @@ interval bound for all variables, it is impossible to use a tuple (since its length is 2); in such case use `bound = Ref((minimum, maximum))`, which has the correct length. """ -function variables(; keys::Vector{Symbol}, bounds = nothing) +function variables(; keys::Union{Vector{Symbol}, Set{Symbol}}, bounds = nothing) bs = isnothing(bounds) ? Base.Iterators.cycle(tuple(nothing)) : length(bounds) == 1 ? Base.Iterators.cycle(bounds) : From 7259a63e005bd9aea6757088fc650b4409c842a8 Mon Sep 17 00:00:00 2001 From: stelmo Date: Sat, 16 Dec 2023 13:55:32 +0000 Subject: [PATCH 2/3] automatic formatting triggered by @stelmo on PR #12 --- src/constraint_tree.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constraint_tree.jl b/src/constraint_tree.jl index 0545d08..5e212c2 100644 --- a/src/constraint_tree.jl +++ b/src/constraint_tree.jl @@ -191,7 +191,7 @@ interval bound for all variables, it is impossible to use a tuple (since its length is 2); in such case use `bound = Ref((minimum, maximum))`, which has the correct length. """ -function variables(; keys::Union{Vector{Symbol}, Set{Symbol}}, bounds = nothing) +function variables(; keys::Union{Vector{Symbol},Set{Symbol}}, bounds = nothing) bs = isnothing(bounds) ? Base.Iterators.cycle(tuple(nothing)) : length(bounds) == 1 ? Base.Iterators.cycle(bounds) : From 8ffe64d949254f03a52d41c2eeceeb5db44c2c7b Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sat, 16 Dec 2023 20:48:10 +0100 Subject: [PATCH 3/3] simplify the type extension --- src/constraint_tree.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constraint_tree.jl b/src/constraint_tree.jl index 5e212c2..c198430 100644 --- a/src/constraint_tree.jl +++ b/src/constraint_tree.jl @@ -191,7 +191,7 @@ interval bound for all variables, it is impossible to use a tuple (since its length is 2); in such case use `bound = Ref((minimum, maximum))`, which has the correct length. """ -function variables(; keys::Union{Vector{Symbol},Set{Symbol}}, bounds = nothing) +function variables(; keys::AbstractVector{Symbol}, bounds = nothing) bs = isnothing(bounds) ? Base.Iterators.cycle(tuple(nothing)) : length(bounds) == 1 ? Base.Iterators.cycle(bounds) :