From aae25470c8f1e88d72924fbdf2d7c674f45c018a Mon Sep 17 00:00:00 2001 From: Michiel Cottaar <MichielCottaar@protonmail.com> Date: Sat, 25 May 2024 15:33:44 +0100 Subject: [PATCH] Fix real_kwargs type --- src/variables.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/variables.jl b/src/variables.jl index 20a6541..ca0978c 100644 --- a/src/variables.jl +++ b/src/variables.jl @@ -361,12 +361,12 @@ If set to a numeric value, a constraint will be added to fix the function value If set to `:min` or `:max`, minimising or maximising this function will be added to the cost function. """ function set_simple_constraints!(block::AbstractBlock, kwargs) - real_kwargs = NamedTuple(key => value for (key, value) in kwargs if !isnothing(value)) + real_kwargs = Dict(key => value for (key, value) in kwargs if !isnothing(value)) for (key, value) in real_kwargs var = variables[key] if var isa AlternateVariable - if var.other_var in real_kwargs + if var.other_var in keys(real_kwargs) error("Set constraints on both $key and $(var.other_var), however they are equivalent.") end invert_value(value::VariableType) = var.to_other(value) -- GitLab