Skip to content

Commit c37c4ce

Browse files
Merge pull request #514 from SciML/ChrisRackauckas-patch-3
Remove undocumented arguments from JumpProcess `solve` dispatch
2 parents 48c6bf9 + f0cfd41 commit c37c4ce

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The documentation includes
3838

3939
## Contributions welcomed!
4040

41+
4142
Contact us in sciml-bridged on Slack to discuss where to get started, the [`Help wanted`](https://github.com/SciML/JumpProcesses.jl/issues/431) issue, or just open a PR to address an open issue or add new functionality. Contributions, no matter how small, are always welcome and appreciated,
4243
including documentation editing/writing. See also the [contribution section](#contributing-and-getting-help).
4344

src/solve.jl

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
function DiffEqBase.__solve(jump_prob::DiffEqBase.AbstractJumpProblem{P},
2-
alg::DiffEqBase.DEAlgorithm, timeseries = [], ts = [], ks = [],
3-
recompile::Type{Val{recompile_flag}} = Val{true};
4-
kwargs...) where {P, recompile_flag}
5-
integrator = init(jump_prob, alg, timeseries, ts, ks, recompile; kwargs...)
2+
alg::DiffEqBase.DEAlgorithm;
3+
kwargs...) where {P}
4+
integrator = __jump_init(jump_prob, alg; kwargs...)
5+
solve!(integrator)
6+
integrator.sol
7+
end
8+
9+
#Ambiguity Fix
10+
function DiffEqBase.__solve(jump_prob::DiffEqBase.AbstractJumpProblem{P},
11+
alg::Union{SciMLBase.AbstractRODEAlgorithm, SciMLBase.AbstractSDEAlgorithm};
12+
kwargs...) where {P}
13+
integrator = __jump_init(jump_prob, alg; kwargs...)
614
solve!(integrator)
715
integrator.sol
816
end
@@ -19,11 +27,14 @@ function DiffEqBase.__solve(jump_prob::DiffEqBase.AbstractJumpProblem; kwargs...
1927
end
2028

2129
function DiffEqBase.__init(_jump_prob::DiffEqBase.AbstractJumpProblem{P},
22-
alg::DiffEqBase.DEAlgorithm, timeseries = [], ts = [], ks = [],
23-
recompile::Type{Val{recompile_flag}} = Val{true};
30+
alg::DiffEqBase.DEAlgorithm; kwargs...) where {P}
31+
__jump_init(_jump_prob, alg; kwargs...)
32+
end
33+
34+
function __jump_init(_jump_prob::DiffEqBase.AbstractJumpProblem{P}, alg;
2435
callback = nothing, seed = nothing,
2536
alias_jump = Threads.threadid() == 1,
26-
kwargs...) where {P, recompile_flag}
37+
kwargs...) where {P}
2738
if alias_jump
2839
jump_prob = _jump_prob
2940
reset_jump_problem!(jump_prob, seed)
@@ -34,12 +45,12 @@ function DiffEqBase.__init(_jump_prob::DiffEqBase.AbstractJumpProblem{P},
3445
# DDEProblems do not have a recompile_flag argument
3546
if jump_prob.prob isa DiffEqBase.AbstractDDEProblem
3647
# callback comes after jump consistent with SSAStepper
37-
integrator = init(jump_prob.prob, alg, timeseries, ts, ks;
48+
integrator = init(jump_prob.prob, alg;
3849
callback = CallbackSet(jump_prob.jump_callback, callback),
3950
kwargs...)
4051
else
4152
# callback comes after jump consistent with SSAStepper
42-
integrator = init(jump_prob.prob, alg, timeseries, ts, ks, recompile;
53+
integrator = init(jump_prob.prob, alg;
4354
callback = CallbackSet(jump_prob.jump_callback, callback),
4455
kwargs...)
4556
end

0 commit comments

Comments
 (0)