Skip to content

Commit 93045ea

Browse files
committed
move extract_alg to a better place
1 parent bf1eeb7 commit 93045ea

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/solve.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,22 @@ function check_prob_alg_pairing(prob, alg)
13521352
end
13531353
end
13541354

1355+
@inline function extract_alg(solve_args, solve_kwargs, prob_kwargs)
1356+
if isempty(solve_args) || isnothing(first(solve_args))
1357+
if haskey(solve_kwargs, :alg)
1358+
solve_kwargs[:alg]
1359+
elseif haskey(prob_kwargs, :alg)
1360+
prob_kwargs[:alg]
1361+
else
1362+
nothing
1363+
end
1364+
elseif first(solve_args) isa SciMLBase.AbstractSciMLAlgorithm
1365+
first(solve_args)
1366+
else
1367+
nothing
1368+
end
1369+
end
1370+
13551371
################### Differentiation
13561372

13571373
"""
@@ -1449,22 +1465,6 @@ function _solve_forward(prob, sensealg, u0, p, originator, args...; merge_callba
14491465
end
14501466
end
14511467

1452-
@inline function extract_alg(solve_args, solve_kwargs, prob_kwargs)
1453-
if isempty(solve_args) || isnothing(first(solve_args))
1454-
if haskey(solve_kwargs, :alg)
1455-
solve_kwargs[:alg]
1456-
elseif haskey(prob_kwargs, :alg)
1457-
prob_kwargs[:alg]
1458-
else
1459-
nothing
1460-
end
1461-
elseif first(solve_args) isa SciMLBase.AbstractSciMLAlgorithm
1462-
first(solve_args)
1463-
else
1464-
nothing
1465-
end
1466-
end
1467-
14681468
####
14691469
# Catch undefined AD overload cases
14701470

0 commit comments

Comments
 (0)