Skip to content

Commit 74be2a2

Browse files
authored
Merge branch 'main' into ef/inactive-particles
2 parents 0777416 + 8e68904 commit 74be2a2

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

.github/workflows/FormatCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
#
2626
# julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version = "0.13.0"))'
2727
run: |
28-
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.62"))'
28+
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="2.1.2"))'
2929
julia -e 'using JuliaFormatter; format(".")'
3030
- name: Format check
3131
run: |

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PointNeighbors"
22
uuid = "1c4d5385-0a27-49de-8e2c-43b175c8985c"
33
authors = ["Erik Faulhaber <erik.faulhaber@uni-koeln.de>"]
4-
version = "0.4.9-dev"
4+
version = "0.6.1"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/neighborhood_search.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ end
221221
pos_diff = point_coords - neighbor_coords
222222
distance2 = dot(pos_diff, pos_diff)
223223

224-
pos_diff, distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
225-
periodic_box)
224+
pos_diff,
225+
distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
226+
periodic_box)
226227

227228
if distance2 <= search_radius^2
228229
distance = sqrt(distance2)

src/nhs_grid.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ end
337337

338338
# `each_cell_index(cell_list)` might return a `KeySet`, which has to be `collect`ed
339339
# first to be able to be used in a threaded loop. This function takes care of that.
340-
@threaded parallelization_backend for cell_index in each_cell_index_threadable(cell_list)
340+
@threaded parallelization_backend for cell_index in
341+
each_cell_index_threadable(cell_list)
341342
mark_changed_cell!(neighborhood_search, cell_index, y)
342343
end
343344
end
@@ -391,12 +392,13 @@ function update_grid!(neighborhood_search::GridNeighborhoodSearch{<:Any,
391392
# We can work around this by using the old lengths.
392393
# TODO this is hardcoded for the `FullGridCellList`
393394
@threaded parallelization_backend for i in eachindex(update_buffer,
394-
cell_list.cells.lengths)
395+
cell_list.cells.lengths)
395396
update_buffer[i] = cell_list.cells.lengths[i]
396397
end
397398

398399
# Add points to new cells
399-
@threaded parallelization_backend for cell_index in each_cell_index_threadable(cell_list)
400+
@threaded parallelization_backend for cell_index in
401+
each_cell_index_threadable(cell_list)
400402
for i in 1:update_buffer[cell_index]
401403
point = cell_list.cells.backend[i, cell_index]
402404
point_coords = extract_svector(y, Val(ndims(neighborhood_search)), point)
@@ -410,7 +412,8 @@ function update_grid!(neighborhood_search::GridNeighborhoodSearch{<:Any,
410412
end
411413

412414
# Remove points from old cells
413-
@threaded parallelization_backend for cell_index in each_cell_index_threadable(cell_list)
415+
@threaded parallelization_backend for cell_index in
416+
each_cell_index_threadable(cell_list)
414417
points = cell_list[cell_index]
415418

416419
# WARNING!!!
@@ -465,8 +468,9 @@ end
465468
pos_diff = point_coords - neighbor_coords
466469
distance2 = dot(pos_diff, pos_diff)
467470

468-
pos_diff, distance2 = compute_periodic_distance(pos_diff, distance2,
469-
search_radius, periodic_box)
471+
pos_diff,
472+
distance2 = compute_periodic_distance(pos_diff, distance2,
473+
search_radius, periodic_box)
470474

471475
if distance2 <= search_radius^2
472476
distance = sqrt(distance2)

src/nhs_precomputed.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ end
118118
pos_diff = point_coords - neighbor_coords
119119
distance2 = dot(pos_diff, pos_diff)
120120

121-
pos_diff, distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
122-
periodic_box)
121+
pos_diff,
122+
distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
123+
periodic_box)
123124

124125
distance = sqrt(distance2)
125126

test/neighborhood_search.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@
123123
]
124124

125125
seeds = [1, 2]
126-
name(size, seed) = "$(length(size))D with $(prod(size)) Particles " *
127-
"($(seed == 1 ? "`initialize!`" : "`update!`"))"
126+
name(size,
127+
seed) = "$(length(size))D with $(prod(size)) Particles " *
128+
"($(seed == 1 ? "`initialize!`" : "`update!`"))"
128129
@testset verbose=true "$(name(cloud_size, seed)))" for cloud_size in cloud_sizes,
129130
seed in seeds
130-
131131
coords = point_cloud(cloud_size, seed = seed)
132132
NDIMS = length(cloud_size)
133133
n_points = size(coords, 2)

0 commit comments

Comments
 (0)