Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 6 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,29 @@ authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]
[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"]
1 change: 1 addition & 0 deletions src/GeometricIntegratorsDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/solve.jl
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -126,15 +126,15 @@ 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]
else
_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:
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions test/explicit_imports_test.jl

This file was deleted.

16 changes: 16 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
20 changes: 20 additions & 0 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -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
),
),
),
)
9 changes: 5 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/test_groups.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ versions = ["lts", "1", "pre"]

[NoPre]
versions = ["lts", "1"]

[QA]
versions = ["lts", "1"]
in_all = false
Loading