Skip to content

Commit

Permalink
Fix BVP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Avik Pal committed Sep 21, 2023
1 parent ee4931c commit 7b2d7f7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "1.98.2" # Remember to make it 2.0.0
version = "2.0.0"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
2 changes: 1 addition & 1 deletion test/downstream/ensemble_bvp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ tspan = (0.0, pi / 2)
p = [rand()]
bvp = BVProblem(ode!, bc!, initial_guess, tspan, p)
ensemble_prob = EnsembleProblem(bvp, prob_func = prob_func)
sim = solve(ensemble_prob, GeneralMIRK4(), trajectories = 10, dt = 0.1)
sim = solve(ensemble_prob, MIRK4(), trajectories = 10, dt = 0.1)
49 changes: 30 additions & 19 deletions test/function_building_error_messages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ IntegralProblem(intf, [0.0], [1.0], p)
x = [1.0, 2.0]
y = rand(2, 2)
SampledIntegralProblem(y, x)
SampledIntegralProblem(y, x; dim=2)
SampledIntegralProblem(y, x; dim = 2)

# Optimization

Expand Down Expand Up @@ -516,10 +516,7 @@ bcjac(u, p, t) = [1.0]
bcoop,
jac = bjac,
bcjac = bcjac)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip,
bciip,
jac = bjac,
bcjac = bcjac)
BVPFunction(bfiip, bciip, jac = bjac, bcjac = bcjac)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop,
bciip,
jac = bjac,
Expand All @@ -528,8 +525,14 @@ BVPFunction(bfoop, bcoop, jac = bjac)
bjac(du, u, p, t) = [1.0]
bcjac(du, u, p, t) = [1.0]
BVPFunction(bfiip, bciip, jac = bjac, bcjac = bcjac)
BVPFunction(bfoop, bciip, jac = bjac, bcjac = bcjac)
BVPFunction(bfiip, bcoop, jac = bjac, bcjac = bcjac)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop,
bciip,
jac = bjac,
bcjac = bcjac)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip,
bcoop,
jac = bjac,
bcjac = bcjac)
BVPFunction(bfoop, bcoop, jac = bjac, bcjac = bcjac)

bWfact(u, t) = [1.0]
Expand All @@ -540,10 +543,10 @@ bWfact(u, p, t) = [1.0]
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfoop, bciip, Wfact = bWfact)
bWfact(u, p, gamma, t) = [1.0]
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip, bciip, Wfact = bWfact)
BVPFunction(bfoop, bciip, Wfact = bWfact)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, Wfact = bWfact)
bWfact(du, u, p, gamma, t) = [1.0]
BVPFunction(bfiip, bciip, Wfact = bWfact)
BVPFunction(bfoop, bciip, Wfact = bWfact)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, Wfact = bWfact)

bWfact_t(u, t) = [1.0]
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfiip, bciip, Wfact_t = bWfact_t)
Expand All @@ -555,20 +558,24 @@ bWfact_t(u, p, gamma, t) = [1.0]
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip,
bciip,
Wfact_t = bWfact_t)
BVPFunction(bfoop, bciip, Wfact_t = bWfact_t)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop,
bciip,
Wfact_t = bWfact_t)
bWfact_t(du, u, p, gamma, t) = [1.0]
BVPFunction(bfiip, bciip, Wfact_t = bWfact_t)
BVPFunction(bfoop, bciip, Wfact_t = bWfact_t)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop,
bciip,
Wfact_t = bWfact_t)

btgrad(u, t) = [1.0]
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfiip, bciip, tgrad = btgrad)
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfoop, bciip, tgrad = btgrad)
btgrad(u, p, t) = [1.0]
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip, bciip, tgrad = btgrad)
BVPFunction(bfoop, bciip, tgrad = btgrad)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, tgrad = btgrad)
btgrad(du, u, p, t) = [1.0]
BVPFunction(bfiip, bciip, tgrad = btgrad)
BVPFunction(bfoop, bciip, tgrad = btgrad)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, tgrad = btgrad)

bparamjac(u, t) = [1.0]
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfiip, bciip, paramjac = bparamjac)
Expand All @@ -577,27 +584,31 @@ bparamjac(u, p, t) = [1.0]
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip,
bciip,
paramjac = bparamjac)
BVPFunction(bfoop, bciip, paramjac = bparamjac)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop,
bciip,
paramjac = bparamjac)
bparamjac(du, u, p, t) = [1.0]
BVPFunction(bfiip, bciip, paramjac = bparamjac)
BVPFunction(bfoop, bciip, paramjac = bparamjac)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop,
bciip,
paramjac = bparamjac)

bjvp(u, p, t) = [1.0]
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfiip, bciip, jvp = bjvp)
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfoop, bciip, jvp = bjvp)
bjvp(u, v, p, t) = [1.0]
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip, bciip, jvp = bjvp)
BVPFunction(bfoop, bciip, jvp = bjvp)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, jvp = bjvp)
bjvp(du, u, v, p, t) = [1.0]
BVPFunction(bfiip, bciip, jvp = bjvp)
BVPFunction(bfoop, bciip, jvp = bjvp)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, jvp = bjvp)

bvjp(u, p, t) = [1.0]
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfiip, bciip, vjp = bvjp)
@test_throws SciMLBase.TooFewArgumentsError BVPFunction(bfoop, bciip, vjp = bvjp)
bvjp(u, v, p, t) = [1.0]
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfiip, bciip, vjp = bvjp)
BVPFunction(bfoop, bciip, vjp = bvjp)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, vjp = bvjp)
bvjp(du, u, v, p, t) = [1.0]
BVPFunction(bfiip, bciip, vjp = bvjp)
BVPFunction(bfoop, bciip, vjp = bvjp)
@test_throws SciMLBase.NonconformingFunctionsError BVPFunction(bfoop, bciip, vjp = bvjp)

0 comments on commit 7b2d7f7

Please sign in to comment.