Skip to content

Commit

Permalink
Missed the setindex bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
smillerc committed Sep 28, 2022
1 parent f1d6e71 commit a5bff72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BlockHaloArrays"
uuid = "8029ca6b-11ad-4a59-88a2-2e6eee4ef8a2"
authors = ["Sam Miller <[email protected]> and contributors"]
version = "0.4.2"
version = "0.4.3"

[deps]
EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949"
Expand Down
2 changes: 1 addition & 1 deletion src/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ since the actual data within the BlockHaloArray is a series of separate blocks.
the array in this manner will be slower due to the additional arithmetic needed to find the global
to local index conversion for each block.
"""
function Base.setindex!(A::BlockHaloArray, v, global_idx::Vararg{Int,N}) where {N}
function Base.setindex!(A::BlockHaloArray, v, global_idx::NTuple{N,Int}) where {N}
block_idx = ntuple(i ->
get_block_idx(global_idx[A.halodims[i]],
A._cummulative_blocksize_per_dim,
Expand Down
5 changes: 4 additions & 1 deletion test/unit/test_util_funcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ end
A = BlockHaloArray(x, nhalo, nblocks)

@test all(A[1] .== A.blocks[1])
@test_nowarn A[4] .= 2.5
end

@testitem "n-D Indexing" begin
Expand All @@ -104,7 +105,9 @@ end
@test A[1] == A.blocks[1]
@test size(A[1]) == (24, 24)
@test A[1][3,3] == x[1,1]

@test_nowarn A[1][3,3] = 1.2

@test B[1][1,3,3] == y[1,1,1]
@test B[1][:,3,3] == y[:,1,1]
@test_nowarn B[1][1,3,3] =6.7
end

2 comments on commit a5bff72

@smillerc
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/69155

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 v0.4.3 -m "<description of version>" a5bff721d8ed83bde57996fe3be337998bbf6b3b
git push origin v0.4.3

Please sign in to comment.