Skip to content

Commit 9294132

Browse files
rafaqzLilithHafner
andauthored
reword eachslice docs to allow other slices objects (#57428)
The wording of `eachslice` was overly strict in enforcing a `Slices` return type, instead of allowing other objects with similar behavior but e.g. potentially additional behaviors. The existence of `AbstractSlices` suggests this was actually intended at some stage but did not make it into the docs. AxisKeys.jl already returns something else and it seems not to cause any problems, but it would be good to be able to do this without breaking the documented contract of the method. --------- Co-authored-by: Lilith Orion Hafner <[email protected]>
1 parent 7b7ba33 commit 9294132

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

base/slicearray.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ end
7777
"""
7878
eachslice(A::AbstractArray; dims, drop=true)
7979
80-
Create a [`Slices`](@ref) object that is an array of slices over dimensions `dims` of `A`, returning
81-
views that select all the data from the other dimensions in `A`. `dims` can either be an
82-
integer or a tuple of integers.
80+
Create a sliced object, usually [`Slices`](@ref), that is an array of slices over dimensions
81+
`dims` of `A`, returning views that select all the data from the other dimensions in `A`.
82+
`dims` can either be an integer or a tuple of integers.
8383
84-
If `drop = true` (the default), the outer `Slices` will drop the inner dimensions, and
84+
If `drop = true` (the default), the outer slices will drop the inner dimensions, and
8585
the ordering of the dimensions will match those in `dims`. If `drop = false`, then the
86-
`Slices` will have the same dimensionality as the underlying array, with inner
86+
slices object will have the same dimensionality as the underlying array, with inner
8787
dimensions having size 1.
8888
8989
See [`stack`](@ref)`(slices; dims)` for the inverse of `eachslice(A; dims::Integer)`.

0 commit comments

Comments
 (0)