Skip to content

Commit

Permalink
Fix 155 (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
meggart authored Feb 23, 2024
1 parent 387d910 commit 24bbb8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/diskarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ splitcs(::Tuple{}, csnow, csrem) = (csnow, csrem)

function getindex_disk(a, i::Union{Integer,CartesianIndex}...)
checkscalar(i)
checkbounds(a,i...)
outputarray = Array{eltype(a)}(undef, map(_ -> 1, size(a))...)
i = Base.to_indices(a, i)
j = map(1:ndims(a)) do d
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ end
@test DiskArrays.can_scalar() == true
@test DiskArrays.checkscalar(Bool, 1, 2, 3) == true
@test DiskArrays.checkscalar(Bool, :, 2:5, 3) == true
a = AccessCountDiskArray(reshape(1:24,2,3,4),chunksize=(2,2,2))
@test a[1,2,3] == 15
@test a[1,2,3,1] == 15
@test_throws BoundsError a[1,2]
@test a[CartesianIndex(1,2),3] == 15
@test a[CartesianIndex(1,2,3)] == 15
end

function test_getindex(a)
Expand Down

2 comments on commit 24bbb8e

@meggart
Copy link
Collaborator 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/102000

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 v0.4.0 -m "<description of version>" 24bbb8ede27ae9efc30d51eb1fe503011ed7c436
git push origin v0.4.0

Please sign in to comment.