Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit cc16775

Browse files
authored
Merge pull request #33 from JuliaEarth/auto-juliaformatter-pr
[AUTO] JuliaFormatter.jl run
2 parents 947df5f + c8fad6a commit cc16775

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/processes.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Base.rand(rng::Random.AbstractRNG, p::PointProcess, g; algo=default_sampling_alg
3232
Base.rand(p::PointProcess, g, n::Int; algo=default_sampling_algorithm(p, g)) =
3333
rand(Random.GLOBAL_RNG, p, g, n; algo=algo)
3434

35-
Base.rand(p::PointProcess, g; algo=default_sampling_algorithm(p, g)) =
36-
rand(Random.GLOBAL_RNG, p, g; algo=algo)
35+
Base.rand(p::PointProcess, g; algo=default_sampling_algorithm(p, g)) = rand(Random.GLOBAL_RNG, p, g; algo=algo)
3736

3837
"""
3938
rand_single(rng, p, g, algo)

src/processes/poisson.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Base.union(p₁::PoissonProcess{<:Real}, p₂::PoissonProcess{<:Function}) = Poi
2323

2424
Base.union(p₁::PoissonProcess{<:Function}, p₂::PoissonProcess{<:Real}) = PoissonProcess(x -> p₁.λ(x) + p₂.λ)
2525

26-
Base.union(p₁::PoissonProcess{<:AbstractVector}, p₂::PoissonProcess{<:AbstractVector}) = PoissonProcess(x -> p₁.λ + p₂.λ)
26+
Base.union(p₁::PoissonProcess{<:AbstractVector}, p₂::PoissonProcess{<:AbstractVector}) =
27+
PoissonProcess(x -> p₁.λ + p₂.λ)
2728

2829
ishomogeneous(p::PoissonProcess{<:Real}) = true
2930

@@ -95,7 +96,7 @@ function rand_single(rng::Random.AbstractRNG, p::PoissonProcess{<:AbstractVector
9596
nothing
9697
else
9798
# sample elements with weights proportial to expected number of points
98-
w = WeightedSampling(n, λ .* V, replace = true)
99+
w = WeightedSampling(n, λ .* V, replace=true)
99100

100101
# within each element sample a single point
101102
sampler = HomogeneousSampling(1)

test/processes.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
@testset "Processes" begin
2-
seg = Segment((0.0,0.0), (11.3,11.3))
2+
seg = Segment((0.0, 0.0), (11.3, 11.3))
33
tri = Triangle((0.0, 0.0), (5.65, 0.0), (5.65, 5.65))
4-
quad = Quadrangle((0.0,0.0), (0.0,4.0), (4.0, 4.0), (4.0, 0.0))
5-
box = Box((0.0,0.0), (4.0, 4.0))
6-
ball = Ball((1.0,1.0), 2.25)
7-
outer = Point2[(0,-4),(4,-1),(4,1.5),(0,3)]
8-
hole1 = Point2[(0.2,-0.2),(1.4,-0.2),(1.4,0.6),(0.2,0.6)]
9-
hole2 = Point2[(2,-0.2),(3,-0.2),(3,0.4),(2,0.4)]
4+
quad = Quadrangle((0.0, 0.0), (0.0, 4.0), (4.0, 4.0), (4.0, 0.0))
5+
box = Box((0.0, 0.0), (4.0, 4.0))
6+
ball = Ball((1.0, 1.0), 2.25)
7+
outer = Point2[(0, -4), (4, -1), (4, 1.5), (0, 3)]
8+
hole1 = Point2[(0.2, -0.2), (1.4, -0.2), (1.4, 0.6), (0.2, 0.6)]
9+
hole2 = Point2[(2, -0.2), (3, -0.2), (3, 0.4), (2, 0.4)]
1010
poly = PolyArea(outer, [hole1, hole2])
11-
grid = CartesianGrid((0,0), (4,4), dims = (10, 10))
11+
grid = CartesianGrid((0, 0), (4, 4), dims=(10, 10))
1212
points = Point2[(0, 0), (4.5, 0), (0, 4.2), (4, 4.3), (1.5, 1.5)]
1313
connec = connect.([(1, 2, 5), (2, 4, 5), (4, 3, 5), (3, 1, 5)], Triangle)
1414
mesh = SimpleMesh(points, connec)
@@ -48,11 +48,11 @@
4848
pp = rand(p, g)
4949
@test all((g), pp)
5050
# custom thinnedsampling using λmax
51-
pp = rand(p, g, algo = PointPatterns.ThinnedSampling(λ(Point2(12.0, 12.0))))
51+
pp = rand(p, g, algo=PointPatterns.ThinnedSampling(λ(Point2(12.0, 12.0))))
5252
@test all((g), pp)
5353
# discretizedsampling
5454
g = discretize(g)
55-
pp = rand(p, g, algo = PointPatterns.DiscretizedSampling())
55+
pp = rand(p, g, algo=PointPatterns.DiscretizedSampling())
5656
@test all((g), g)
5757
end
5858

0 commit comments

Comments
 (0)