diff --git a/Project.toml b/Project.toml index 4cc2ba6..43d24e5 100644 --- a/Project.toml +++ b/Project.toml @@ -6,27 +6,29 @@ authors = ["Chris Rackauckas "] [deps] DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" GeometricIntegrators = "dcce2d33-59f6-5b8d-9047-0defad88ae06" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1" [compat] DiffEqBase = "6.62, 7" -ExplicitImports = "1.14.0" GeometricIntegrators = "0.15.5, 0.16" +ODEProblemLibrary = "0.1, 1" +RecursiveArrayTools = "2, 3, 4" Reexport = "0.2, 1" SafeTestsets = "0.0.1, 0.1" SciMLBase = "2, 3" SciMLLogging = "1.10.1, 2" -SciMLTesting = "1" +SciMLTesting = "1.7" +Test = "1.10" julia = "1.10" [extras] -ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["ExplicitImports", "ODEProblemLibrary", "SafeTestsets", "SciMLTesting", "Test"] +test = ["ODEProblemLibrary", "SafeTestsets", "SciMLTesting", "Test"] diff --git a/src/GeometricIntegratorsDiffEq.jl b/src/GeometricIntegratorsDiffEq.jl index 1f1b178..7b851fb 100644 --- a/src/GeometricIntegratorsDiffEq.jl +++ b/src/GeometricIntegratorsDiffEq.jl @@ -4,6 +4,7 @@ using Reexport: Reexport, @reexport @reexport using DiffEqBase: DiffEqBase using SciMLBase: SciMLBase, ReturnCode using SciMLLogging: @SciMLMessage +using RecursiveArrayTools: RecursiveArrayTools using GeometricIntegrators: GeometricIntegrators, CrankNicolson, Crouzeix, ExplicitEuler, ExplicitMidpoint, Gauss, Heun2, Heun3, ImplicitEuler, diff --git a/src/algorithms.jl b/src/algorithms.jl index 8ca60c1..29f5d83 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -1,4 +1,4 @@ -abstract type GeometricIntegratorAlgorithm <: DiffEqBase.AbstractODEAlgorithm end +abstract type GeometricIntegratorAlgorithm <: SciMLBase.AbstractODEAlgorithm end struct GIEuler <: GeometricIntegratorAlgorithm end struct GIMidpoint <: GeometricIntegratorAlgorithm end struct GIHeun2 <: GeometricIntegratorAlgorithm end diff --git a/src/solve.jl b/src/solve.jl index d8e3bad..aec0611 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -1,5 +1,5 @@ -function DiffEqBase.__solve( - prob::DiffEqBase.AbstractODEProblem{uType, tType, isinplace}, +function SciMLBase.__solve( + prob::SciMLBase.AbstractODEProblem{uType, tType, isinplace}, alg::AlgType, timeseries = nothing, ts = nothing, ks = nothing; verbose = true, @@ -41,15 +41,15 @@ function DiffEqBase.__solve( warned = true end end - if !(prob.f isa DiffEqBase.AbstractParameterizedFunction) && isstiff - if DiffEqBase.has_tgrad(prob.f) + if !(prob.f isa SciMLBase.AbstractParameterizedFunction) && isstiff + if SciMLBase.has_tgrad(prob.f) @SciMLMessage( "Explicit t-gradient given to this stiff solver is ignored.", verbose, :mismatched_input_output_type ) warned = true end - if DiffEqBase.has_jac(prob.f) + if SciMLBase.has_jac(prob.f) @SciMLMessage( "Explicit Jacobian given to this stiff solver is ignored.", verbose, :mismatched_input_output_type @@ -91,7 +91,7 @@ function DiffEqBase.__solve( _alg = get_method_from_alg(alg) needs_solver = requires_newton_solver(alg) - if prob.problem_type isa DiffEqBase.StandardODEProblem + if prob.problem_type isa SciMLBase.StandardODEProblem # Create function wrapper for GeometricIntegrators API # GeometricIntegrators expects: v(v, t, q, params) # DiffEqBase provides: f(du, u, p, t) for inplace or f(u, p, t) for out-of-place @@ -126,7 +126,7 @@ function DiffEqBase.__solve( ts = (prob.tspan[1] + dt):dt:prob.tspan[end] end - if u0 isa DiffEqBase.RecursiveArrayTools.ArrayPartition + if u0 isa RecursiveArrayTools.ArrayPartition _timeseries = [copy(vec(q)) for q in sol.q] elseif u0 isa AbstractArray _timeseries = [reshape(copy(vec(q)), sizeu) for q in sol.q] @@ -134,7 +134,7 @@ function DiffEqBase.__solve( _timeseries = [q[1] for q in sol.q] end - elseif prob.problem_type isa DiffEqBase.AbstractDynamicalODEProblem + elseif prob.problem_type isa SciMLBase.AbstractDynamicalODEProblem # For second order / partitioned problems # PODE expects: v(v, t, q, p, params), f(f, t, q, p, params) # DiffEqBase SecondOrderODEProblem has f.f1 and f.f2: @@ -178,12 +178,12 @@ function DiffEqBase.__solve( end _timeseries = [ - DiffEqBase.RecursiveArrayTools.ArrayPartition(copy(vec(q)), copy(vec(p))) + RecursiveArrayTools.ArrayPartition(copy(vec(q)), copy(vec(p))) for (q, p) in zip(sol.q, sol.p) ] end - return DiffEqBase.build_solution( + return SciMLBase.build_solution( prob, alg, ts, _timeseries[start_idx:end], timeseries_errors = timeseries_errors, retcode = ReturnCode.Success diff --git a/test/explicit_imports_test.jl b/test/explicit_imports_test.jl deleted file mode 100644 index a97314a..0000000 --- a/test/explicit_imports_test.jl +++ /dev/null @@ -1,8 +0,0 @@ -using ExplicitImports -using GeometricIntegratorsDiffEq -using Test - -@testset "Explicit Imports" begin - @test check_no_implicit_imports(GeometricIntegratorsDiffEq) === nothing - @test check_no_stale_explicit_imports(GeometricIntegratorsDiffEq) === nothing -end diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000..3145bfe --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,16 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +GeometricIntegratorsDiffEq = "5a33fad7-5ce4-5983-9f5d-5f26ceab5c96" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +GeometricIntegratorsDiffEq = {path = "../.."} + +[compat] +Aqua = "0.8" +SafeTestsets = "0.0.1, 0.1, 1" +SciMLTesting = "1.7" +Test = "1.10" +julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl new file mode 100644 index 0000000..e9ea72f --- /dev/null +++ b/test/qa/qa.jl @@ -0,0 +1,20 @@ +using SciMLTesting, GeometricIntegratorsDiffEq, Test + +run_qa( + GeometricIntegratorsDiffEq; + explicit_imports = true, + ei_kwargs = (; + # The names below are still non-public in their owner's latest registered + # release (verified on Julia 1.12 against SciMLBase 3.28.1 that + # `Base.ispublic` returns `false` for each): SciMLBase API-extension + # points / problem types not yet `public`-declared. Ignore them until they + # go public upstream. + all_qualified_accesses_are_public = (; + ignore = ( + :StandardODEProblem, # SciMLBase + :__solve, # SciMLBase + :unwrapped_f, # SciMLBase + ), + ), + ), +) diff --git a/test/runtests.jl b/test/runtests.jl index 81b4385..b27615c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,13 +4,14 @@ using SciMLTesting run_tests(; core = function () - @safetestset "GeometricIntegratorsDiffEq" begin + return @safetestset "GeometricIntegratorsDiffEq" begin include("core_tests.jl") end - return @safetestset "Explicit Imports" begin - include("explicit_imports_test.jl") - end end, + qa = (; + env = joinpath(@__DIR__, "qa"), + body = joinpath(@__DIR__, "qa", "qa.jl"), + ), groups = Dict( # NoPre runs the JET and AllocCheck tests in their own environment. The # original dispatcher ran these only for GROUP=="NoPre" (never as part of diff --git a/test/test_groups.toml b/test/test_groups.toml index e69be8a..f762020 100644 --- a/test/test_groups.toml +++ b/test/test_groups.toml @@ -3,3 +3,7 @@ versions = ["lts", "1", "pre"] [NoPre] versions = ["lts", "1"] + +[QA] +versions = ["lts", "1"] +in_all = false