Skip to content

Commit 2f31389

Browse files
format
1 parent 5852794 commit 2f31389

12 files changed

+63
-28
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DiffEqBase"
22
uuid = "2b5f629d-d688-5b77-993f-72d75c75574e"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "6.155.4"
4+
version = "6.156.0"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

ext/DiffEqBaseEnzymeExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ end
5555

5656
Enzyme.Compiler.known_ops[typeof(DiffEqBase.fastpow)] = (:pow, 2, nothing)
5757

58-
end
58+
end

ext/DiffEqBaseReverseDiffExt.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import ReverseDiff
66
import DiffEqBase.ArrayInterface
77
import DiffEqBase.ForwardDiff
88

9-
function DiffEqBase.anyeltypedual(::Type{T}, ::Type{Val{counter}} = Val{0}) where {counter} where {V, D, N, VA, DA, T <: ReverseDiff.TrackedArray{V, D, N, VA, DA}}
9+
function DiffEqBase.anyeltypedual(::Type{T},
10+
::Type{Val{counter}} = Val{0}) where {counter} where {
11+
V, D, N, VA, DA, T <: ReverseDiff.TrackedArray{V, D, N, VA, DA}}
1012
DiffEqBase.anyeltypedual(V, Val{counter})
1113
end
1214

@@ -38,7 +40,10 @@ function DiffEqBase.promote_u0(u0::AbstractArray{<:ReverseDiff.TrackedReal},
3840
u0
3941
end
4042
DiffEqBase.promote_u0(u0, p::ReverseDiff.TrackedArray, t0) = ReverseDiff.track(u0)
41-
DiffEqBase.promote_u0(u0, p::ReverseDiff.TrackedArray{T}, t0) where {T <: ForwardDiff.Dual} = ReverseDiff.track(T.(u0))
43+
function DiffEqBase.promote_u0(
44+
u0, p::ReverseDiff.TrackedArray{T}, t0) where {T <: ForwardDiff.Dual}
45+
ReverseDiff.track(T.(u0))
46+
end
4247
DiffEqBase.promote_u0(u0, p::AbstractArray{<:ReverseDiff.TrackedReal}, t0) = eltype(p).(u0)
4348

4449
# Support adaptive with non-tracked time

src/callbacks.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,10 @@ function apply_callback!(integrator,
588588
end
589589

590590
if integrator.u_modified
591-
if hasmethod(reeval_internals_due_to_modification!, Tuple{typeof(integrator)}, (:callback_initializealg,))
592-
reeval_internals_due_to_modification!(integrator, callback_initializealg = callback.initializealg)
591+
if hasmethod(reeval_internals_due_to_modification!,
592+
Tuple{typeof(integrator)}, (:callback_initializealg,))
593+
reeval_internals_due_to_modification!(
594+
integrator, callback_initializealg = callback.initializealg)
593595
else # handle legacy dispatch without kwarg
594596
reeval_internals_due_to_modification!(integrator)
595597
end
@@ -617,8 +619,10 @@ end
617619
integrator.u_modified = true
618620
callback.affect!(integrator)
619621
if integrator.u_modified
620-
if hasmethod(reeval_internals_due_to_modification!, Tuple{typeof(integrator), Bool}, (:callback_initializealg,))
621-
reeval_internals_due_to_modification!(integrator, false, callback_initializealg = callback.initializealg)
622+
if hasmethod(reeval_internals_due_to_modification!,
623+
Tuple{typeof(integrator), Bool}, (:callback_initializealg,))
624+
reeval_internals_due_to_modification!(
625+
integrator, false, callback_initializealg = callback.initializealg)
622626
else # handle legacy dispatch without kwarg
623627
reeval_internals_due_to_modification!(integrator, false)
624628
end

src/fastpow.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ const EXP2FT = (Float32(0x1.6a09e667f3bcdp-1),
6161
if iszero(x)
6262
return zero(outT)
6363
elseif isinf(x) && isinf(y)
64-
return convert(outT,Inf)
64+
return convert(outT, Inf)
6565
else
66-
return convert(outT,@fastmath exp2(convert(Float32, y) * fastlog2(convert(Float32, x))))
66+
return convert(
67+
outT, @fastmath exp2(convert(Float32, y) * fastlog2(convert(Float32, x))))
6768
end
6869
end
6970

src/forwarddiff.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,10 @@ function anyeltypedual(x::NamedTuple, ::Type{Val{counter}} = Val{0}) where {coun
347347
anyeltypedual(values(x))
348348
end
349349

350-
DiffEqBase.anyeltypedual(f::SciMLBase.AbstractSciMLFunction, ::Type{Val{counter}}) where {counter} = Any
350+
function DiffEqBase.anyeltypedual(
351+
f::SciMLBase.AbstractSciMLFunction, ::Type{Val{counter}}) where {counter}
352+
Any
353+
end
351354

352355
@inline promote_u0(::Nothing, p, t0) = nothing
353356

src/integrator_accessors.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# the following are setup per how integrators are implemented in OrdinaryDiffEq and
22
# StochasticDiffEq and provide dispatch points that JumpProcesses and others can use.
33

4-
get_tstops(integ::DEIntegrator) =
4+
function get_tstops(integ::DEIntegrator)
55
error("get_tstops not implemented for integrators of type $(nameof(typeof(integ)))")
6-
get_tstops_array(integ::DEIntegrator) =
6+
end
7+
function get_tstops_array(integ::DEIntegrator)
78
error("get_tstops_array not implemented for integrators of type $(nameof(typeof(integ)))")
8-
get_tstops_max(integ::DEIntegrator) =
9+
end
10+
function get_tstops_max(integ::DEIntegrator)
911
error("get_tstops_max not implemented for integrators of type $(nameof(typeof(integ)))")
12+
end

src/solve.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,8 @@ function __solve(
13921392
kwargs...)
13931393
if second_time
13941394
throw(NoDefaultAlgorithmError())
1395-
elseif length(args) > 0 && !(first(args) isa Union{Nothing, AbstractDEAlgorithm, AbstractNonlinearAlgorithm})
1395+
elseif length(args) > 0 && !(first(args) isa
1396+
Union{Nothing, AbstractDEAlgorithm, AbstractNonlinearAlgorithm})
13961397
throw(NonSolverError())
13971398
else
13981399
__solve(prob, nothing, args...; default_set = false, second_time = true, kwargs...)
@@ -1403,7 +1404,8 @@ function __init(prob::AbstractDEProblem, args...; default_set = false, second_ti
14031404
kwargs...)
14041405
if second_time
14051406
throw(NoDefaultAlgorithmError())
1406-
elseif length(args) > 0 && !(first(args) isa Union{Nothing, AbstractDEAlgorithm, AbstractNonlinearAlgorithm})
1407+
elseif length(args) > 0 && !(first(args) isa
1408+
Union{Nothing, AbstractDEAlgorithm, AbstractNonlinearAlgorithm})
14071409
throw(NonSolverError())
14081410
else
14091411
__init(prob, nothing, args...; default_set = false, second_time = true, kwargs...)

test/downstream/enzyme.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ using Test
66
@testset for RT in (Duplicated, DuplicatedNoNeed),
77
Tx in (Const, Duplicated),
88
Ty in (Const, Duplicated)
9+
910
x = 3.0
1011
y = 2.0
11-
test_forward(fastpow, RT, (x, Tx), (y, Ty), atol=0.005, rtol=0.005)
12+
test_forward(fastpow, RT, (x, Tx), (y, Ty), atol = 0.005, rtol = 0.005)
1213
end
1314
end
1415

1516
@testset "Fast pow - Enzyme reverse rule" begin
1617
@testset for RT in (Active,),
1718
Tx in (Active,),
1819
Ty in (Active,)
20+
1921
x = 2.0
2022
y = 3.0
21-
test_reverse(fastpow, RT, (x, Tx), (y, Ty), atol=0.001, rtol=0.001)
23+
test_reverse(fastpow, RT, (x, Tx), (y, Ty), atol = 0.001, rtol = 0.001)
2224
end
23-
end
25+
end

test/downstream/tables.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ sol1 = solve(prob, Euler(); dt = 1 // 2^(4));
55
df = DataFrame(sol1)
66
@test names(df) == ["timestamp", "value1", "value2", "value3", "value4"]
77

8-
prob = ODEProblem(ODEFunction(f_2dlinear, sys = SymbolicIndexingInterface.SymbolCache([:a, :b, :c, :d], [], :t)), rand(2, 2), (0.0, 1.0));
8+
prob = ODEProblem(
9+
ODEFunction(
10+
f_2dlinear, sys = SymbolicIndexingInterface.SymbolCache([:a, :b, :c, :d], [], :t)),
11+
rand(2, 2),
12+
(0.0, 1.0));
913
sol2 = solve(prob, Euler(); dt = 1 // 2^(4));
1014
df = DataFrame(sol2)
1115
@test names(df) == ["timestamp", "a", "b", "c", "d"]

0 commit comments

Comments
 (0)