Skip to content

Commit fe47203

Browse files
Drop Runic reformatting and check from this PR
JumpProcesses ran the centralized JuliaFormatter format-check, not Runic. Switching it to the centralized Runic check reformatted the entire repo (~85 files), which is too large to bundle with the CI migration. Restore the original FormatCheck.yml (JuliaFormatter) and revert the reformatting; Runic adoption can be a separate, focused PR. Kept: Documentation/Downgrade/SpellCheck central callers, dependabot cleanup, _typos.toml, and the 2 real typo fixes the spell check surfaced. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9d6e6ed commit fe47203

80 files changed

Lines changed: 1650 additions & 2675 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/FormatCheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Format Check"
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
format-check:
12+
name: "Format Check"
13+
uses: "SciML/.github/.github/workflows/format-check.yml@v1"

.github/workflows/Runic.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

benchmarks/extended_jump_array.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ benchmark_out = ExtendedJumpArray(zeros(500000), zeros(500000))
1010
benchmark_in = ExtendedJumpArray(rand(rng, 500000), rand(rng, 500000))
1111

1212
function test_single_dot(out, array)
13-
return @inbounds @. out = array + 1.23 * array
13+
@inbounds @. out = array + 1.23 * array
1414
end
1515

1616
println("Base-case normal broadcasting")

docs/make.jl

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,23 @@ cp(joinpath(docpath, "Project.toml"), joinpath(assetpath, "Project.toml"), force
1111

1212
include("pages.jl")
1313

14-
mathengine = MathJax3(
15-
Dict(
16-
:loader => Dict("load" => ["[tex]/require", "[tex]/mathtools"]), :tex => Dict(
17-
"inlineMath" => [["\$", "\$"], ["\\(", "\\)"]],
18-
"packages" => [
19-
"base",
20-
"ams",
21-
"autoload",
22-
"mathtools",
23-
"require",
24-
]
25-
)
26-
)
27-
)
14+
mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/require", "[tex]/mathtools"]), :tex => Dict("inlineMath" => [["\$", "\$"], ["\\(", "\\)"]],
15+
"packages" => [
16+
"base",
17+
"ams",
18+
"autoload",
19+
"mathtools",
20+
"require"
21+
])))
2822

29-
makedocs(
30-
sitename = "JumpProcesses.jl", authors = "Chris Rackauckas", modules = [JumpProcesses],
23+
makedocs(sitename = "JumpProcesses.jl", authors = "Chris Rackauckas", modules = [JumpProcesses],
3124
clean = true, doctest = false, linkcheck = true, warnonly = [:missing_docs],
32-
format = Documenter.HTML(;
33-
assets = ["assets/favicon.ico"],
25+
format = Documenter.HTML(; assets = ["assets/favicon.ico"],
3426
canonical = "https://docs.sciml.ai/JumpProcesses/",
3527
prettyurls = (get(ENV, "CI", nothing) == "true"),
3628
mathengine,
3729
edit_link = "master",
38-
repolink = "https://github.com/SciML/JumpProcesses.jl"
39-
),
40-
pages = pages
41-
)
30+
repolink = "https://github.com/SciML/JumpProcesses.jl"),
31+
pages = pages)
4232

4333
deploydocs(repo = "github.com/SciML/JumpProcesses.jl.git"; push_preview = true)

docs/pages.jl

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
# Put in a separate page so it can be used by SciMLDocs.jl
22

3-
pages = [
4-
"index.md",
5-
"Tutorials" => Any[
6-
"tutorials/simple_poisson_process.md",
3+
pages = ["index.md",
4+
"Tutorials" => Any["tutorials/simple_poisson_process.md",
75
"tutorials/discrete_stochastic_example.md",
86
"tutorials/point_process_simulation.md",
97
"tutorials/jump_diffusion.md",
10-
"tutorials/spatial.md",
11-
],
8+
"tutorials/spatial.md"],
129
"Applications" => Any["applications/advanced_point_process.md"],
13-
"Type Documentation" => Any[
14-
"Jumps, JumpProblem, and Aggregators" => "jump_types.md",
15-
"Jump solvers" => "jump_solve.md",
16-
],
10+
"Type Documentation" => Any["Jumps, JumpProblem, and Aggregators" => "jump_types.md",
11+
"Jump solvers" => "jump_solve.md"],
1712
"FAQ" => "faq.md",
18-
"API" => "api.md",
13+
"API" => "api.md"
1914
]

ext/JumpProcessesKernelAbstractionsExt.jl

Lines changed: 41 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,20 @@ using KernelAbstractions, Adapt
55
using StaticArrays
66
using PoissonRandom, Random
77

8-
function SciMLBase.__solve(
9-
ensembleprob::SciMLBase.AbstractEnsembleProblem,
8+
function SciMLBase.__solve(ensembleprob::SciMLBase.AbstractEnsembleProblem,
109
alg::SimpleTauLeaping,
1110
ensemblealg::EnsembleGPUKernel;
1211
trajectories,
1312
seed = nothing,
1413
dt = error("dt is required for SimpleTauLeaping."),
15-
kwargs...
16-
)
14+
kwargs...)
1715
if trajectories == 1
18-
return SciMLBase.__solve(
19-
ensembleprob, alg, EnsembleSerial(); trajectories = 1,
20-
seed, dt, kwargs...
21-
)
16+
return SciMLBase.__solve(ensembleprob, alg, EnsembleSerial(); trajectories = 1,
17+
seed, dt, kwargs...)
2218
end
2319

2420
ensemblealg.backend === nothing ? backend = CPU() :
25-
backend = ensemblealg.backend
21+
backend = ensemblealg.backend
2622

2723
jump_prob = ensembleprob.prob
2824

@@ -35,42 +31,36 @@ function SciMLBase.__solve(
3531

3632
# Run vectorized solve
3733
ts,
38-
us = vectorized_solve(
39-
probs, jump_prob, SimpleTauLeaping(); backend, trajectories, seed, dt
40-
)
34+
us = vectorized_solve(
35+
probs, jump_prob, SimpleTauLeaping(); backend, trajectories, seed, dt)
4136

4237
# Convert to CPU for inspection
4338
_ts = Array(ts)
4439
_us = Array(us)
4540

46-
time = @elapsed sol = [
47-
begin
48-
ts = @view _ts[:, i]
49-
us = @view _us[:, :, i]
50-
sol_idx = findlast(x -> x != probs[i].prob.tspan[1], ts)
51-
if sol_idx === nothing
52-
@error "No solution found" tspan = probs[i].tspan[1] ts
53-
error("Batch solve failed")
54-
end
55-
@views ensembleprob.output_func(
56-
SciMLBase.build_solution(
57-
probs[i].prob,
58-
alg,
59-
ts[1:sol_idx],
60-
[us[j, :] for j in 1:sol_idx],
61-
k = nothing,
62-
stats = nothing,
63-
calculate_error = false,
64-
retcode = sol_idx !=
65-
length(ts) ?
66-
ReturnCode.Terminated :
67-
ReturnCode.Success
68-
),
69-
i
70-
)[1]
71-
end
72-
for i in eachindex(probs)
73-
]
41+
time = @elapsed sol = [begin
42+
ts = @view _ts[:, i]
43+
us = @view _us[:, :, i]
44+
sol_idx = findlast(x -> x != probs[i].prob.tspan[1], ts)
45+
if sol_idx === nothing
46+
@error "No solution found" tspan=probs[i].tspan[1] ts
47+
error("Batch solve failed")
48+
end
49+
@views ensembleprob.output_func(
50+
SciMLBase.build_solution(probs[i].prob,
51+
alg,
52+
ts[1:sol_idx],
53+
[us[j, :] for j in 1:sol_idx],
54+
k = nothing,
55+
stats = nothing,
56+
calculate_error = false,
57+
retcode = sol_idx !=
58+
length(ts) ?
59+
ReturnCode.Terminated :
60+
ReturnCode.Success),
61+
i)[1]
62+
end
63+
for i in eachindex(probs)]
7464
return SciMLBase.EnsembleSolution(sol, time, true)
7565
end
7666

@@ -92,8 +82,7 @@ end
9282
@kernel function simple_tau_leaping_kernel(
9383
@Const(probs_data), _us, _ts, dt, @Const(rj_data),
9484
current_u_buf, rate_cache_buf, counts_buf, local_dc_buf,
95-
seed::UInt64
96-
)
85+
seed::UInt64)
9786
i = @index(Global, Linear)
9887

9988
# Get thread-local buffers
@@ -125,7 +114,7 @@ end
125114

126115
# Get input/output arrays
127116
ts_view = @inbounds view(_ts, :, i)
128-
us_view = @inbounds view(_us, :, :, i)
117+
us_view = @inbounds view(_us,:,:,i)
129118

130119
# Initialize first time step and state
131120
@inbounds ts_view[1] = tspan[1]
@@ -135,7 +124,7 @@ end
135124

136125
# Main loop
137126
for j in 2:n
138-
tprev = tspan[1] + (j - 2) * dt
127+
tprev = tspan[1] + (j-2) * dt
139128

140129
# Compute rates and scale by dt
141130
rate(rate_cache, current_u, p, tprev)
@@ -154,24 +143,20 @@ end
154143
@inbounds for k in 1:state_dim
155144
us_view[j, k] = current_u[k]
156145
end
157-
@inbounds ts_view[j] = tspan[1] + (j - 1) * dt
146+
@inbounds ts_view[j] = tspan[1] + (j-1) * dt
158147
end
159148
end
160149

161150
# Vectorized solve function
162-
function vectorized_solve(
163-
probs, prob::JumpProblem, alg::SimpleTauLeaping;
164-
backend, trajectories, seed, dt, kwargs...
165-
)
151+
function vectorized_solve(probs, prob::JumpProblem, alg::SimpleTauLeaping;
152+
backend, trajectories, seed, dt, kwargs...)
166153
# Extract common jump data
167154
rj = prob.regular_jump
168155
rj_data = JumpData(rj.rate, rj.c, rj.numjumps)
169156

170157
# Extract trajectory-specific data without static typing
171-
probs_data = [
172-
TrajectoryData(SA{eltype(p.prob.u0)}[p.prob.u0...], p.prob.p, p.prob.tspan)
173-
for p in probs
174-
]
158+
probs_data = [TrajectoryData(SA{eltype(p.prob.u0)}[p.prob.u0...], p.prob.p, p.prob.tspan)
159+
for p in probs]
175160

176161
# Adapt to GPU
177162
probs_data_gpu = adapt(backend, probs_data)
@@ -212,15 +197,13 @@ function vectorized_solve(
212197
KernelAbstractions.synchronize(backend)
213198

214199
# Seed for Poisson sampling
215-
seed = seed === nothing ? UInt64(12345) : UInt64(seed)
200+
seed = seed === nothing ? UInt64(12345) : UInt64(seed);
216201

217202
# Launch main kernel
218203
kernel = simple_tau_leaping_kernel(backend)
219-
main_event = kernel(
220-
probs_data_gpu, us, ts, dt, rj_data_gpu,
204+
main_event = kernel(probs_data_gpu, us, ts, dt, rj_data_gpu,
221205
current_u_buf, rate_cache_buf, counts_buf, local_dc_buf, seed;
222-
ndrange = n_trajectories
223-
)
206+
ndrange = n_trajectories)
224207
KernelAbstractions.synchronize(backend)
225208

226209
return ts, us

ext/JumpProcessesOrdinaryDiffEqCoreExt.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ import OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm, DAEAlgorithm,
1616
# the exact algorithm union from OrdinaryDiffEqCore.
1717
function DiffEqBase.__init(
1818
_jump_prob::DiffEqBase.AbstractJumpProblem{P},
19-
alg::Union{
20-
OrdinaryDiffEqAlgorithm, DAEAlgorithm,
21-
StochasticDiffEqAlgorithm, StochasticDiffEqRODEAlgorithm,
22-
};
23-
merge_callbacks = true, kwargs...
24-
) where {P}
19+
alg::Union{OrdinaryDiffEqAlgorithm, DAEAlgorithm,
20+
StochasticDiffEqAlgorithm, StochasticDiffEqRODEAlgorithm};
21+
merge_callbacks = true, kwargs...) where {P}
2522
kwargs = DiffEqBase.merge_problem_kwargs(_jump_prob; merge_callbacks, kwargs...)
26-
return JumpProcesses.__jump_init(_jump_prob, alg; kwargs...)
23+
JumpProcesses.__jump_init(_jump_prob, alg; kwargs...)
2724
end
2825

2926
end

src/JumpProcesses.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ import SymbolicIndexingInterface as SII
3636

3737
# Import additional types and functions from DiffEqBase and SciMLBase
3838
using DiffEqBase: DiffEqBase, CallbackSet, ContinuousCallback, DAEFunction,
39-
DDEFunction, DiscreteProblem, ODEFunction, ODEProblem,
40-
ODESolution, ReturnCode, SDEFunction, SDEProblem, add_tstop!,
41-
deleteat!, isinplace, remake, savevalues!, step!,
42-
u_modified!
39+
DDEFunction, DiscreteProblem, ODEFunction, ODEProblem,
40+
ODESolution, ReturnCode, SDEFunction, SDEProblem, add_tstop!,
41+
deleteat!, isinplace, remake, savevalues!, step!,
42+
u_modified!
4343
using SciMLBase: SciMLBase, DEIntegrator
4444

4545
abstract type AbstractJump end
4646
abstract type AbstractMassActionJump <: AbstractJump end
4747
abstract type AbstractAggregatorAlgorithm end
4848
abstract type AbstractJumpAggregator end
4949
abstract type AbstractSSAIntegrator{Alg, IIP, U, T} <:
50-
DEIntegrator{Alg, IIP, U, T} end
50+
DEIntegrator{Alg, IIP, U, T} end
5151

5252
const DEFAULT_RNG = Random.default_rng()
5353

@@ -129,7 +129,7 @@ export init, solve, solve!
129129
include("SSA_stepper.jl")
130130
export SSAStepper
131131

132-
# leaping:
132+
# leaping:
133133
include("simple_regular_solve.jl")
134134
export SimpleTauLeaping, SimpleExplicitTauLeaping, EnsembleGPUKernel
135135

0 commit comments

Comments
 (0)