@@ -504,28 +504,28 @@ function init_up(prob::DEProblem, sensealg, u0, p, args...; kwargs...)
504
504
_alg = prepare_alg (alg, _prob. u0, _prob. p, _prob)
505
505
check_prob_alg_pairing (_prob, alg) # alg for improved inference
506
506
507
- if length (args) === 1 && args[ 1 ] === nothing
507
+ if length (args) <= 1
508
508
init_call (_prob, _alg; kwargs... )
509
509
else
510
- init_call (_prob, _alg, args[ 2 : end ] . .. ; kwargs... )
510
+ init_call (_prob, _alg, Base . tail ( args) ... ; kwargs... )
511
511
end
512
512
elseif haskey (prob. kwargs, :alg ) && (isempty (args) || args[1 ] === nothing )
513
513
alg = prob. kwargs[:alg ]
514
514
_prob = get_concrete_problem (prob, isadaptive (alg); kwargs... )
515
515
_alg = prepare_alg (alg, _prob. u0, _prob. p, _prob)
516
516
check_prob_alg_pairing (_prob, alg) # alg for improved inference
517
- if length (args) === 1 && args[ 1 ] === nothing
517
+ if length (args) <= 1
518
518
init_call (_prob, _alg; kwargs... )
519
519
else
520
- init_call (_prob, _alg, args[ 2 : end ] . .. ; kwargs... )
520
+ init_call (_prob, _alg, Base . tail ( args) ... ; kwargs... )
521
521
end
522
522
elseif ! isempty (args) && typeof (args[1 ]) <: DEAlgorithm
523
523
alg = args[1 ]
524
524
_prob = get_concrete_problem (prob, isadaptive (alg); kwargs... )
525
525
check_prob_alg_pairing (_prob, alg)
526
526
_alg = prepare_alg (alg, _prob. u0, _prob. p, _prob)
527
- init_call (_prob, _alg, args[ 2 : end ] . .. ; kwargs... )
528
- else
527
+ init_call (_prob, _alg, Base . tail ( args) ... ; kwargs... )
528
+ else # Default algorithm handling
529
529
_prob = get_concrete_problem (prob, ! (typeof (prob) <: DiscreteProblem ); kwargs... )
530
530
init_call (_prob, args... ; kwargs... )
531
531
end
@@ -1006,20 +1006,20 @@ function solve_up(prob::Union{DEProblem, NonlinearProblem}, sensealg, u0, p, arg
1006
1006
_prob = get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1007
1007
_alg = prepare_alg (alg, _prob. u0, _prob. p, _prob)
1008
1008
check_prob_alg_pairing (_prob, alg) # use alg for improved inference
1009
- if length (args) === 1 && args[ 1 ] === nothing
1009
+ if length (args) <= 1
1010
1010
solve_call (_prob, _alg; kwargs... )
1011
1011
else
1012
- solve_call (_prob, _alg, args[ 2 : end ] . .. ; kwargs... )
1012
+ solve_call (_prob, _alg, Base . tail ( args) ... ; kwargs... )
1013
1013
end
1014
1014
elseif haskey (prob. kwargs, :alg ) && (isempty (args) || args[1 ] === nothing )
1015
1015
alg = prob. kwargs[:alg ]
1016
1016
_prob = get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1017
1017
_alg = prepare_alg (alg, _prob. u0, _prob. p, _prob)
1018
1018
check_prob_alg_pairing (_prob, alg) # use alg for improved inference
1019
- if length (args) === 1 && args[ 1 ] === nothing
1019
+ if length (args) <= 1
1020
1020
solve_call (_prob, _alg; kwargs... )
1021
1021
else
1022
- solve_call (_prob, _alg, args[ 2 : end ] . .. ; kwargs... )
1022
+ solve_call (_prob, _alg, Base . tail ( args) ... ; kwargs... )
1023
1023
end
1024
1024
elseif ! isempty (args) && typeof (args[1 ]) <: DEAlgorithm
1025
1025
alg = args[1 ]
0 commit comments