Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/remake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function remake(prob::ODEProblem; f = missing,

iip = isinplace(prob)

if build_initializeprob == Val{true} || build_initializeprob == true
if build_initializeprob isa Val{true} || build_initializeprob == true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build_initializeprob defaults to Val{true} and Val{true} isa Val{true} == false so this won't run?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right ... 🤦

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other way to do it is build_initializeprob === Val{true}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't help. Looks like the problem is inside the if, within remake_initialization_data::Any. I effectively just made it if false so it never ran.

if f !== missing && has_initialization_data(f)
initialization_data = remake_initialization_data(
prob.f.sys, f, u0, tspan[1], p, newu0, newp)
Expand Down
7 changes: 7 additions & 0 deletions test/downstream/solution_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,10 @@ end
sol = solve(prob)
@test sol(0.6, idxs = y) ≈ 2.0
end

@testset "Type stability of MTK workflow" begin
@variables x(t)
@mtkbuild sys = ODESystem([D(x) ~ 0.0], t; defaults = [x => 0.0])
prob = ODEProblem(sys, [], (0.0, 1.0))
@test_nowarn @inferred solve(prob, Tsit5())
end
Loading