Skip to content

Commit

Permalink
remove ambiguities, fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Jun 15, 2022
1 parent ac943fa commit 6cfb3b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions src/ptr_array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,13 @@ end
end
@inline Base.axes(A::AbstractStrideArray, i::Integer) = axes(A, i)

@inline function ArrayInterface.size(A::AbstractStrideVector, i::Integer)
d = Int(length(A))
ifelse(isone(i), d, one(d))
end
@inline function ArrayInterface.size(A::AbstractStrideVector, i::Int)
d = Int(length(A))
ifelse(isone(i), d, one(d))
end
@inline ArrayInterface.size(::AbstractStrideVector, ::StaticInt{N}) where {N} = One()
@inline ArrayInterface.size(A::AbstractStrideVector, ::StaticInt{1}) = length(A)
@inline ArrayInterface.size(A::AbstractStrideArray, ::StaticInt{N}) where {N} = size(A)[N]
@inline ArrayInterface.size(A::AbstractStrideArray, i::Integer) =
type_stable_select(size(A), i)
@inline ArrayInterface.size(A::AbstractStrideArray, i::Int) = type_stable_select(size(A), i)
@inline Base.size(A::AbstractStrideArray, i::Integer) = size(A, i)

Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ allocated_cartesianindexsum(x) = @allocated cartesianindexsum(x)
end
@testset "views" begin
B0 = reshape(collect(1:12), 3, 4)
B1 = StrideArray(A)
B1 = StrideArray(B0)
@test view(B0, :, 4:-1:1) == view(B1, :, 4:-1:1)
@test view(B0, :, 1:2:4) == view(B1, :, 1:2:4)
A = StrideArray{Float64}(undef, (100, 100)) .= rand.()
Expand Down

2 comments on commit 6cfb3b0

@chriselrod
Copy link
Member 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 updated: JuliaRegistries/General/62378

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.3.10 -m "<description of version>" 6cfb3b0e30508b777d93e54f12b3477f81c82b82
git push origin v0.3.10

Please sign in to comment.