From 7b2d7f74aa5d2b77d91b00aa997f4c497b321299 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Thu, 21 Sep 2023 13:44:02 -0400 Subject: [PATCH] Fix BVP tests --- Project.toml | 2 +- test/downstream/ensemble_bvp.jl | 2 +- test/function_building_error_messages.jl | 49 +++++++++++++++--------- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/Project.toml b/Project.toml index c63cead23..492af0df1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "1.98.2" # Remember to make it 2.0.0 +version = "2.0.0" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/test/downstream/ensemble_bvp.jl b/test/downstream/ensemble_bvp.jl index 4f3b2bc2a..ad08236c7 100644 --- a/test/downstream/ensemble_bvp.jl +++ b/test/downstream/ensemble_bvp.jl @@ -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) diff --git a/test/function_building_error_messages.jl b/test/function_building_error_messages.jl index c424a6f84..279c80e73 100644 --- a/test/function_building_error_messages.jl +++ b/test/function_building_error_messages.jl @@ -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 @@ -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, @@ -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] @@ -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) @@ -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) @@ -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)