Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: call complete on systems generated in MTKExt #690

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/OptimizationMTKExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
num_cons = 0)
p = isnothing(p) ? SciMLBase.NullParameters() : p

sys = ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, x, p;
sys = complete(ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, x, p;

Check warning on line 13 in ext/OptimizationMTKExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/OptimizationMTKExt.jl#L13

Added line #L13 was not covered by tests
lcons = fill(0.0,
num_cons),
ucons = fill(0.0,
num_cons)))
num_cons))))
#sys = ModelingToolkit.structural_simplify(sys)
f = OptimizationProblem(sys, x, p, grad = true, hess = true,
sparse = adtype.obj_sparse, cons_j = true, cons_h = true,
Expand Down Expand Up @@ -56,11 +56,11 @@
adtype::AutoModelingToolkit, num_cons = 0)
p = isnothing(cache.p) ? SciMLBase.NullParameters() : cache.p

sys = ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, cache.u0, cache.p;
sys = complete(ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, cache.u0, cache.p;

Check warning on line 59 in ext/OptimizationMTKExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/OptimizationMTKExt.jl#L59

Added line #L59 was not covered by tests
lcons = fill(0.0,
num_cons),
ucons = fill(0.0,
num_cons)))
num_cons))))
#sys = ModelingToolkit.structural_simplify(sys)
f = OptimizationProblem(sys, cache.u0, cache.p, grad = true, hess = true,
sparse = adtype.obj_sparse, cons_j = true, cons_h = true,
Expand Down
Loading