You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add validation for constrained optimization problems missing bounds
When a constrained optimization problem has constraints defined but
is missing lcons or ucons bounds, provide a helpful error message
instead of allowing it to fail with cryptic errors downstream.
This addresses SciML/Optimization.jl#959 by adding the validation
at the SciMLBase level so all optimization solvers benefit from it.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: src/solve.jl
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,10 @@ function _check_opt_alg(prob::OptimizationProblem, alg; kwargs...)
151
151
throw(IncompatibleOptimizerError("The algorithm $(typeof(alg)) does not support constraints. Either remove the `cons` function passed to `OptimizationFunction` or use a different algorithm."))
throw(IncompatibleOptimizerError("The algorithm $(typeof(alg)) does not support callbacks, remove the `callback` keyword argument from the `solve` call."))
156
160
requiresgradient(alg) &&!(prob.f isa AbstractOptimizationFunction) &&
0 commit comments