Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
Add missing DefaultArrayInterface methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Jan 9, 2025
1 parent d194ece commit 8d0ecd4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/defaultarrayinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,27 @@ function interface(a::Type{<:AbstractArray})
parenttype(a) === a && return DefaultArrayInterface()
return interface(parenttype(a))
end

@interface ::DefaultArrayInterface function Base.getindex(

Check warning on line 10 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L10

Added line #L10 was not covered by tests
a::AbstractArray{<:Any,N}, I::Vararg{Int,N}
) where {N}
return Base.getindex(a, I...)

Check warning on line 13 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L13

Added line #L13 was not covered by tests
end

@interface ::DefaultArrayInterface function Base.setindex!(

Check warning on line 16 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L16

Added line #L16 was not covered by tests
a::AbstractArray{<:Any,N}, value, I::Vararg{Int,N}
) where {N}
return Base.setindex!(a, value, I...)

Check warning on line 19 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L19

Added line #L19 was not covered by tests
end

@interface ::DefaultArrayInterface function Base.map!(

Check warning on line 22 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L22

Added line #L22 was not covered by tests
f, a_dest::AbstractArray, a_srcs::AbstractArray...
)
return Base.map!(f, a_dest, a_srcs...)

Check warning on line 25 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L25

Added line #L25 was not covered by tests
end

@interface ::DefaultArrayInterface function Base.mapreduce(

Check warning on line 28 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L28

Added line #L28 was not covered by tests
f, op, as::AbstractArray...; kwargs...
)
return Base.mapreduce(f, op, as...; kwargs...)

Check warning on line 31 in src/defaultarrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/defaultarrayinterface.jl#L31

Added line #L31 was not covered by tests
end

0 comments on commit 8d0ecd4

Please sign in to comment.