Skip to content

Commit

Permalink
Merge pull request #40 from henry2004y/main
Browse files Browse the repository at this point in the history
Bump ChunkSplitters to 3.0
  • Loading branch information
DanielVandH authored Oct 20, 2024
2 parents d07c5af + 2f1e45f commit 24be1a0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NaturalNeighbours"
uuid = "f16ad982-4edb-46b1-8125-78e5a8b5a9e6"
authors = ["Daniel VandenHeuvel <[email protected]>"]
version = "1.3.5"
version = "1.3.6"

[deps]
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
Expand All @@ -11,7 +11,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
ChunkSplitters = "1.0, 2.0"
ChunkSplitters = "3.0"
DelaunayTriangulation = "1.0"
ElasticArrays = "1.2"
julia = "1.9"
Expand Down
2 changes: 1 addition & 1 deletion src/NaturalNeighbours.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import DelaunayTriangulation: DelaunayTriangulation,
get_boundary_nodes,
triangle_vertices

import ChunkSplitters: chunks
import ChunkSplitters: index_chunks
using ElasticArrays
using LinearAlgebra
using Random
Expand Down
4 changes: 2 additions & 2 deletions src/differentiation/differentiate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ function (∂::NaturalNeighboursDifferentiator)(vals::AbstractVector, x::Abstrac
end
else
nt = Base.Threads.nthreads()
chunked_iterator = chunks(vals, nt)
Threads.@threads for (xrange, chunk_id) in chunked_iterator
chunked_iterator = index_chunks(vals; n=nt)
Threads.@threads for (chunk_id, xrange) in enumerate(chunked_iterator)
for i in xrange
vals[i] = (x[i], y[i], chunk_id; method, interpolant_method, kwargs...)
end
Expand Down
8 changes: 4 additions & 4 deletions src/differentiation/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ function generate_derivatives(
generate_second_order_derivatives!(∇, ℋ, method, tri, z, eachindex(z), derivative_caches, neighbour_caches, 1; alpha, use_cubic_terms, initial_gradients)
else
nt = length(derivative_caches)
chunked_iterator = chunks(z, nt)
Base.Threads.@threads for (zrange, chunk_id) in chunked_iterator
chunked_iterator = index_chunks(z; n=nt)
Base.Threads.@threads for (chunk_id, zrange) in enumerate(chunked_iterator)
generate_second_order_derivatives!(∇, ℋ, method, tri, z, zrange, derivative_caches, neighbour_caches, chunk_id; alpha, use_cubic_terms, initial_gradients)
end
end
Expand Down Expand Up @@ -124,8 +124,8 @@ function generate_gradients(
generate_first_order_derivatives!(∇, Direct(), tri, z, eachindex(z), derivative_caches, neighbour_caches, 1)
else
nt = length(derivative_caches)
chunked_iterator = chunks(∇, nt)
Base.Threads.@threads for (zrange, chunk_id) in chunked_iterator
chunked_iterator = index_chunks(∇; n=nt)
Base.Threads.@threads for (chunk_id, zrange) in enumerate(chunked_iterator)
generate_first_order_derivatives!(∇, Direct(), tri, z, zrange, derivative_caches, neighbour_caches, chunk_id)
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/interpolation/interpolate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ function (itp::NaturalNeighboursInterpolant)(vals::AbstractVector, x::AbstractVe
else
caches = get_neighbour_cache(itp)
nt = length(caches)
chunked_iterator = chunks(vals, nt)
Threads.@threads for (xrange, chunk_id) in chunked_iterator
chunked_iterator = index_chunks(vals; n=nt)
Threads.@threads for (chunk_id, xrange) in enumerate(chunked_iterator)
for i in xrange
vals[i] = itp(x[i], y[i], chunk_id; method, kwargs...)
end
Expand Down

2 comments on commit 24be1a0

@DanielVandH
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/117699

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.6 -m "<description of version>" 24be1a0a6d92f32dac5fed779cd2017eebd26eca
git push origin v1.3.6

Please sign in to comment.