-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
remake
failures
#3396
Comments
@test oprob1[X1] == 1.0
@test oprob1[X2] == 2.0
@test oprob1[Y1] == 3.0
@test oprob1[Y2] == 4.0
@test oprob1[V] == 5.0
@test oprob1[W] == 6.0
# ... This requires #3290 to be fixed. Trivial initialization isn't run in the constructor yet. As such, for the explanations below I've updated the function test_vals(prob, us_correct::Dict, ps_correct::Dict)
integ = init(prob)
for u in keys(us_correct)
# @test prob[u] == us_correct[u]
@test integ[u] == us_correct[u]
end
for p in keys(ps_correct)
# @test prob.ps[p] == ps_correct[p]
@test integ.ps[p] == ps_correct[p]
end
end test_vals(oprob1,
Dict(X1 => 10.0, X2 => 2.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 5.0, v => 5.0, w => 6.0, Γ[1] => 12.0, Γ[2] => 7.0)) Isn't this test incorrect? julia> test_vals(oprob1,
Dict(X1 => 1.0, X2 => 2.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 3.0, v => 5.0, w => 6.0, Γ[1] => 3.0, Γ[2] => 7.0)) This is the correct test call. test_vals(oprob2,
Dict(X1 => 10.0, X2 => 20.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 5.0, v => 5.0, w => 6.0, Γ[1] => 30.0, Γ[2] => 7.0))
julia> test_vals(oprob2,
Dict(X1 => 10.0, X2 => 2.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 3.0, v => 5.0, w => 6.0, Γ[1] => 12.0, Γ[2] => 7.0)) test_vals(oprob3,
Dict(X1 => 1.0, X2 => 20.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 5.0, v => 5.0, w => 6.0, Γ[1] => 21.0, Γ[2] => 7.0)) This is also incorrect. julia> test_vals(oprob3,
Dict(X1 => 10.0, X2 => 20.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 3.0, v => 5.0, w => 6.0, Γ[1] => 30.0, Γ[2] => 7.0)) test_vals(oprob4,
Dict(X1 => 10.0, X2 => 20.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 5.0, v => 5.0, w => 6.0, Γ[1] => 30.0, Γ[2] => 7.0))
julia> test_vals(oprob4,
Dict(X1 => 1.0, X2 => 20.0, Y1 => 30.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 3.0, v => 5.0, w => 6.0, Γ[1] => 21.0, Γ[2] => 34.0)) test_vals(oprob5,
Dict(X1 => 1.0, X2 => 2.0, Y1 => 30.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 5.0, v => 5.0, w => 6.0, Γ[1] => 3.0, Γ[2] => 34.0)) Should be julia> test_vals(oprob5,
Dict(X1 => 10.0, X2 => 20.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 3.0, v => 5.0, w => 6.0, Γ[1] => 30.0, Γ[2] => 7.0)) For the same reasons. Retain the conditions of the original problem, add the constraints provided to Correcting the oprob6 = remake(oprob1, u0 = [Y2 => 40.0], ps = [k1 => 0.4]) to julia> oprob6 = remake(oprob1, u0 = [Y2 => 40.0], p = [k1 => 0.4]) test_vals(oprob6,
Dict(X1 => 1.0, X2 => 2.0, Y1 => 3.0, Y2 => 40.0, V => 5.0, W => 6.0),
Dict(k1 => 0.4, k2 => 0.2, V0 => 5.0, v => 5.0, w => 6.0, Γ[1] => 3.0, Γ[2] => 43.0)) This is a complicated case. julia> test_vals(oprob6,
Dict(X1 => 1.0, X2 => 2.0, Y1 => 3.0, Y2 => 40.0, V => 5.0, W => 6.0),
Dict(k1 => 0.4, k2 => 0.2, V0 => 3.0, v => 3.0, w => 6.0, Γ[1] => 3.0, Γ[2] => 43.0)) Similarly fixing the test_vals(oprob7,
Dict(X1 => 10.0, X2 => 20.0, Y1 => 3.0, Y2 => 4.0, V => 50.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 50.0, v => 50.0, w => 6.0, Γ[1] => 30.0, Γ[2] => 7.0))
julia> test_vals(oprob7,
Dict(X1 => 10.0, X2 => 20.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 6.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 50.0, v => 50.0, w => 6.0, Γ[1] => 30.0, Γ[2] => 7.0)) test_vals(oprob8,
Dict(X1 => 1.0, X2 => 2.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 60.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 5.0, v => 5.0, w => 60.0, Γ[1] => 3.0, Γ[2] => 7.0)) Since julia> test_vals(oprob8,
Dict(X1 => 1.0, X2 => 2.0, Y1 => 3.0, Y2 => 4.0, V => 5.0, W => 60.0),
Dict(k1 => 0.1, k2 => 0.2, V0 => 3.0, v => 5.0, w => 6.0, Γ[1] => 3.0, Γ[2] => 7.0)) I hope this clarifies the issue. |
Thanks a lot! Yeah, there was definitely some stuff that was messed up in the code. I have updated now. Seems we will have to wait for #3290 and #3395 for a starter. Hopefully we can get this all working eventually. Either way, it might make sense to incorporate something like this into the test suite as well? |
#3395 is resolved in #3390. I'm working on fixing other CI issues in that PR, one of which is particularly elusive. #3290 is actually really easy to do - we just need to call |
Just trying to enumerate cases where
remake
fails and where there are some dependency between variables/parameters. Not 100% sure everything is declared correctly should work (and if not, would be useful to know so I can adjust my workflows). However, I have tried various versions, and I do think you always run into some errors one way or another.If someone tells me what should/shout not work I can rework, and then we can incorporate into the tests to ensure stuff works.
The text was updated successfully, but these errors were encountered: