Skip to content

Commit d9d4e41

Browse files
author
SciML Bot
committed
Apply JuliaFormatter to fix code formatting
- Applied JuliaFormatter with SciML style guide - Formatted 7 files 🤖 Generated by OrgMaintenanceScripts.jl
1 parent 3a5ccf4 commit d9d4e41

File tree

7 files changed

+41
-20
lines changed

7 files changed

+41
-20
lines changed

src/compoundpoisson.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ mutable struct CompoundPoissonProcess{R, CR}
1717
function CompoundPoissonProcess(rate, t0, W0; computerates = true, kwargs...)
1818
cpp = new{typeof(rate), typeof(W0)}(rate, W0, computerates)
1919
NoiseProcess{false}(t0, W0, nothing, cpp,
20-
(dW, W, W0, Wh, q, h, u, p, t, rng) -> cpp_bridge(dW, cpp, W,
20+
(dW, W, W0, Wh, q, h, u, p, t,
21+
rng) -> cpp_bridge(dW, cpp, W,
2122
W0, Wh, q, h,
2223
u, p, t, rng);
2324
continuous = false, cache = cpp, kwargs...)
@@ -40,7 +41,8 @@ struct CompoundPoissonProcess!{R, CR}
4041
function CompoundPoissonProcess!(rate, t0, W0; computerates = true, kwargs...)
4142
cpp = new{typeof(rate), typeof(W0)}(rate, copy(W0), computerates)
4243
NoiseProcess{true}(t0, W0, nothing, cpp,
43-
(rand_vec, W, W0, Wh, q, h, u, p, t, rng) -> cpp_bridge!(rand_vec,
44+
(rand_vec, W, W0, Wh, q, h, u, p, t,
45+
rng) -> cpp_bridge!(rand_vec,
4446
cpp, W,
4547
W0, Wh,
4648
q, h, u,

src/geometric_bm.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ GeometricBrownianMotionProcess!(μ,σ,t0,W0,Z0=nothing;kwargs...)
6868
function GeometricBrownianMotionProcess(μ, σ, t0, W0, Z0 = nothing; kwargs...)
6969
gbm = GeometricBrownianMotion(μ, σ)
7070
NoiseProcess{false}(t0, W0, Z0, gbm,
71-
(dW, W, W0, Wh, q, h, u, p, t, rng) -> gbm_bridge(dW, gbm, W, W0,
71+
(dW, W, W0, Wh, q, h, u, p, t,
72+
rng) -> gbm_bridge(dW, gbm, W, W0,
7273
Wh, q, h, u, p, t,
7374
rng); kwargs...)
7475
end
@@ -103,7 +104,8 @@ GeometricBrownianMotionProcess!(μ,σ,t0,W0,Z0=nothing;kwargs...)
103104
function GeometricBrownianMotionProcess!(μ, σ, t0, W0, Z0 = nothing; kwargs...)
104105
gbm = GeometricBrownianMotion!(μ, σ)
105106
NoiseProcess{true}(t0, W0, Z0, gbm,
106-
(rand_vec, W, W0, Wh, q, h, u, p, t, rng) -> gbm_bridge!(rand_vec,
107+
(rand_vec, W, W0, Wh, q, h, u, p, t,
108+
rng) -> gbm_bridge!(rand_vec,
107109
gbm, W, W0,
108110
Wh, q, h, u,
109111
p, t, rng);

src/noise_interfaces/box_wedge_tail_interface.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ end
234234

235235
# joint probability density function
236236
function joint_density_function(r, a, rtol)
237-
integral, err = QuadGK.quadgk(
237+
integral,
238+
err = QuadGK.quadgk(
238239
x -> r / π * (x / sinh(x)) *
239240
exp(-r^2 * x / (2 * tanh(x))) * cos(a * x), 0, Inf,
240241
rtol = rtol)
@@ -439,7 +440,8 @@ function generate_wedges(densf, Δr, Δa, Δz, rM, aM, offset, sqeezing)
439440

440441
# store position of top corner of box and width
441442
if sqeezing
442-
ϵijmin, ϵijmax = constrained_optimization_problem(densf, fij, fij2, fij3,
443+
ϵijmin,
444+
ϵijmax = constrained_optimization_problem(densf, fij, fij2, fij3,
443445
fij4, r, a, Δr, Δa)
444446
push!(boxes, [f̃ij, hij, abs(ϵijmin), abs(ϵijmax), r, a])
445447
# store PDF values

src/noise_interfaces/virtual_brownian_tree_interface.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ function interpolate!(W::VirtualBrownianTree, u, p, t)
2929
W.dZ !== nothing ? val2 = timeseries2[i - 1] : val2 = nothing
3030
else
3131
if W.dZ !== nothing
32-
val1, val2 = search_VBT(t, W.seeds[i - 1], ts[i - 1], ts[i], timeseries[i - 1],
32+
val1,
33+
val2 = search_VBT(t, W.seeds[i - 1], ts[i - 1], ts[i], timeseries[i - 1],
3334
timeseries[i],
3435
timeseries2[i - 1], timeseries2[i], W, W.rng)
3536
else
36-
val1, val2 = search_VBT(t, W.seeds[i - 1], ts[i - 1], ts[i], timeseries[i - 1],
37+
val1,
38+
val2 = search_VBT(t, W.seeds[i - 1], ts[i - 1], ts[i], timeseries[i - 1],
3739
timeseries[i],
3840
nothing, nothing, W, W.rng)
3941
end

src/ornstein_uhlenbeck.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ OrnsteinUhlenbeckProcess!(Θ,μ,σ,t0,W0,Z0=nothing;kwargs...)
7272
function OrnsteinUhlenbeckProcess(Θ, μ, σ, t0, W0, Z0 = nothing; kwargs...)
7373
ou = OrnsteinUhlenbeck(Θ, μ, σ)
7474
NoiseProcess{false}(t0, W0, Z0, ou,
75-
(rand_vec, W, W0, Wh, q, h, u, p, t, rng) -> ou_bridge(rand_vec,
75+
(rand_vec, W, W0, Wh, q, h, u, p, t,
76+
rng) -> ou_bridge(rand_vec,
7677
ou,
7778
W,
7879
W0,
@@ -120,7 +121,8 @@ function OrnsteinUhlenbeckProcess!(Θ, μ, σ, t0, W0, Z0 = nothing; kwargs...)
120121
W0,
121122
Z0,
122123
ou,
123-
(rand_vec, W, W0, Wh, q, h, u, p, t, rng) -> ou_bridge!(rand_vec,
124+
(rand_vec, W, W0, Wh, q, h, u, p, t,
125+
rng) -> ou_bridge!(rand_vec,
124126
ou,
125127
W,
126128
W0,

src/types.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,9 @@ function VirtualBrownianTree{iip}(t0, W0, Z0, dist, bridge;
11931193
Zend = curW + bridge(dZ, nothing, tend - t0, nothing, nothing, nothing, rng)
11941194
end
11951195

1196-
t, W, Z, seeds = create_VBT_cache(
1196+
t, W,
1197+
Z,
1198+
seeds = create_VBT_cache(
11971199
bridge, t0, W0, Z0, tend, Wend, Zend, rng, tree_depth,
11981200
search_depth)
11991201

@@ -1348,7 +1350,8 @@ function BoxWedgeTail{iip}(t0, W0, Z0, dist, bridge;
13481350

13491351
# generate boxes
13501352
if box_grouping == :MinEntropy
1351-
box, probability, offset = generate_boxes2(jpdf, Δr, Δa, Δz, one(Δr), one(Δa),
1353+
box, probability,
1354+
offset = generate_boxes2(jpdf, Δr, Δa, Δz, one(Δr), one(Δa),
13521355
one(Δz) / 64, rM, aM)
13531356
dist_box = Distributions.Categorical(probability / sum(probability))
13541357
boxes = BoxGeneration2{typeof(box), typeof(probability), typeof(offset),

test/BWT_test.jl

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,42 +54,50 @@
5454
@test 2 * val12.98 * 1e-4 rtol=1e-3
5555
@test W.tails.tail1.p2 * val1 rtol=1e-10
5656
# region 2
57-
val2, _ = hcubature(x -> W.jpdf(x[1], x[2]), [W.rM, W.aM],
57+
val2,
58+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [W.rM, W.aM],
5859
[8 * one(W.rM), 8 * one(W.aM)])
5960
@test 2 * val23.65 * 1e-5 rtol=1e-3
6061
@test W.tails.tail2.p2 * val2 rtol=1e-10
6162
# region 3
62-
val3, _ = hcubature(x -> W.jpdf(x[1], x[2]), [2 * one(W.rM), W.aM],
63+
val3,
64+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [2 * one(W.rM), W.aM],
6365
[W.rM, 8 * one(W.aM)])
6466
@test 2 * val31.80 * 1e-3 rtol=1e-2
6567
@test W.tails.tail3.p2 * val3 rtol=1e-10
6668
# region 4
67-
val4, _ = hcubature(x -> W.jpdf(x[1], x[2]), [zero(W.rM), W.aM],
69+
val4,
70+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [zero(W.rM), W.aM],
6871
[one(W.rM) / 2, 6 * one(W.aM)])
6972
@test 2 * val41.61 * 1e-6 rtol=1e-2
7073
@test W.tails.tail4.p2 * val4 rtol=1e-10
7174
# region 5
72-
val5, _ = hcubature(x -> W.jpdf(x[1], x[2]), [one(W.rM) / 2, W.aM],
75+
val5,
76+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [one(W.rM) / 2, W.aM],
7377
[one(W.rM), 6 * one(W.aM)])
7478
@test 2 * val51.96 * 1e-5 rtol=1e-2
7579
@test W.tails.tail5.p2 * val5 rtol=1e-10
7680
# region 6
77-
val6, _ = hcubature(x -> W.jpdf(x[1], x[2]), [one(W.rM), W.aM],
81+
val6,
82+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [one(W.rM), W.aM],
7883
[3 * one(W.rM) / 2, 6 * one(W.aM)])
7984
@test 2 * val61.20 * 1e-4 rtol=1e-2
8085
@test W.tails.tail6.p2 * val6 rtol=1e-10
8186
# region 7
82-
val7, _ = hcubature(x -> W.jpdf(x[1], x[2]), [3 * one(W.rM) / 2, W.aM],
87+
val7,
88+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [3 * one(W.rM) / 2, W.aM],
8389
[2 * one(W.rM), 6 * one(W.aM)])
8490
@test 2 * val73.86 * 1e-4 rtol=1e-3
8591
@test W.tails.tail7.p2 * val7 rtol=1e-10
8692
# region 8
87-
val8, _ = hcubature(x -> W.jpdf(x[1], x[2]), [one(W.rM), 6 * one(W.aM)],
93+
val8,
94+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [one(W.rM), 6 * one(W.aM)],
8895
[2 * one(W.rM), 8 * one(W.aM)])
8996
@test 2 * val86.57 * 1e-6 rtol=1e-3
9097
@test W.tails.tail8.p2 * val8 rtol=1e-10
9198
# region 9
92-
val9, _ = hcubature(x -> W.jpdf(x[1], x[2]), [2 * one(W.rM), 8 * one(W.aM)],
99+
val9,
100+
_ = hcubature(x -> W.jpdf(x[1], x[2]), [2 * one(W.rM), 8 * one(W.aM)],
93101
[5 * one(W.rM), 10 * one(W.aM)])
94102
@test 2 * val94.15 * 1e-6 rtol=1e-3
95103
@test W.tails.tail9.p2 * val9 rtol=1e-10

0 commit comments

Comments
 (0)