Skip to content

Commit

Permalink
add checks kwarg to OptimizationProblem, use in ConstraintSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
aml5600 committed Nov 27, 2024
1 parent eda23d4 commit 57ea5fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/systems/optimization/optimizationsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem, u0map,
linenumbers = true, parallel = SerialForm(),
eval_expression = false, eval_module = @__MODULE__,
use_union = false,
checks = true,
kwargs...) where {iip}
if !iscomplete(sys)
error("A completed `OptimizationSystem` is required. Call `complete` or `structural_simplify` on the system before creating a `OptimizationProblem`")
Expand Down Expand Up @@ -393,7 +394,7 @@ function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem, u0map,
observedfun = ObservedFunctionCache(sys; eval_expression, eval_module)

if length(cstr) > 0
@named cons_sys = ConstraintsSystem(cstr, dvs, ps)
@named cons_sys = ConstraintsSystem(cstr, dvs, ps; checks)
cons_sys = complete(cons_sys)
cons, lcons_, ucons_ = generate_function(cons_sys, checkbounds = checkbounds,
linenumbers = linenumbers,
Expand Down

0 comments on commit 57ea5fc

Please sign in to comment.