Skip to content

Commit 8e68904

Browse files
svchbefaulhaber
andauthored
format (#112)
Co-authored-by: Erik Faulhaber <[email protected]>
1 parent 689aea2 commit 8e68904

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
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: |

src/neighborhood_search.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ end
211211
pos_diff = point_coords - neighbor_coords
212212
distance2 = dot(pos_diff, pos_diff)
213213

214-
pos_diff, distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
215-
periodic_box)
214+
pos_diff,
215+
distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
216+
periodic_box)
216217

217218
if distance2 <= search_radius^2
218219
distance = sqrt(distance2)

src/nhs_grid.jl

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

313313
# `each_cell_index(cell_list)` might return a `KeySet`, which has to be `collect`ed
314314
# first to be able to be used in a threaded loop. This function takes care of that.
315-
@threaded parallelization_backend for cell_index in each_cell_index_threadable(cell_list)
315+
@threaded parallelization_backend for cell_index in
316+
each_cell_index_threadable(cell_list)
316317
mark_changed_cell!(neighborhood_search, cell_index, y)
317318
end
318319
end
@@ -360,12 +361,13 @@ function update_grid!(neighborhood_search::GridNeighborhoodSearch{<:Any,
360361
# We can work around this by using the old lengths.
361362
# TODO this is hardcoded for the `FullGridCellList`
362363
@threaded parallelization_backend for i in eachindex(update_buffer,
363-
cell_list.cells.lengths)
364+
cell_list.cells.lengths)
364365
update_buffer[i] = cell_list.cells.lengths[i]
365366
end
366367

367368
# Add points to new cells
368-
@threaded parallelization_backend for cell_index in each_cell_index_threadable(cell_list)
369+
@threaded parallelization_backend for cell_index in
370+
each_cell_index_threadable(cell_list)
369371
for i in 1:update_buffer[cell_index]
370372
point = cell_list.cells.backend[i, cell_index]
371373
point_coords = extract_svector(y, Val(ndims(neighborhood_search)), point)
@@ -379,7 +381,8 @@ function update_grid!(neighborhood_search::GridNeighborhoodSearch{<:Any,
379381
end
380382

381383
# Remove points from old cells
382-
@threaded parallelization_backend for cell_index in each_cell_index_threadable(cell_list)
384+
@threaded parallelization_backend for cell_index in
385+
each_cell_index_threadable(cell_list)
383386
points = cell_list[cell_index]
384387

385388
# WARNING!!!
@@ -433,8 +436,9 @@ end
433436
pos_diff = point_coords - neighbor_coords
434437
distance2 = dot(pos_diff, pos_diff)
435438

436-
pos_diff, distance2 = compute_periodic_distance(pos_diff, distance2,
437-
search_radius, periodic_box)
439+
pos_diff,
440+
distance2 = compute_periodic_distance(pos_diff, distance2,
441+
search_radius, periodic_box)
438442

439443
if distance2 <= search_radius^2
440444
distance = sqrt(distance2)

src/nhs_precomputed.jl

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

119-
pos_diff, distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
120-
periodic_box)
119+
pos_diff,
120+
distance2 = compute_periodic_distance(pos_diff, distance2, search_radius,
121+
periodic_box)
121122

122123
distance = sqrt(distance2)
123124

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)