Skip to content

Commit

Permalink
Simplify and specify types in blockedrange-related docstrings (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Mar 20, 2024
1 parent ea33af1 commit e0d9eca
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/blockaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Base.unitrange(b::BlockedUnitRange) = first(b):last(b)
Base.promote_rule(::Type{BlockedUnitRange{CS}}, ::Type{Base.OneTo{Int}}) where CS = UnitRange{Int}

"""
blockaxes(A)
blockaxes(A::AbstractArray)
Return the tuple of valid block indices for array `A`.
Expand Down Expand Up @@ -163,13 +163,13 @@ _blockaxes(b::Tuple) = (Block.(Base.OneTo(length(b))),)
blockaxes(b) = blockaxes.(axes(b), 1)

"""
blockaxes(A, d)
blockaxes(A::AbstractArray, d::Int)
Return the valid range of block indices for array `A` along dimension `d`.
# Examples
```jldoctest
julia> A = BlockArray([1,2,3],[2,1])
julia> A = BlockArray([1,2,3], [2,1])
2-blocked 3-element BlockVector{Int64}:
1
2
Expand All @@ -190,8 +190,8 @@ julia> blockaxes(A,1) |> collect
end

"""
blocksize(A)
blocksize(A,i)
blocksize(A::AbstractArray)
blocksize(A::AbstractArray, i::Int)
Return the tuple of the number of blocks along each
dimension. See also size and blocksizes.
Expand All @@ -217,8 +217,8 @@ blocksize(A,i) = length(blockaxes(A,i))
@inline blocklength(t) = prod(blocksize(t))

"""
blocksizes(A)
blocksizes(A,i)
blocksizes(A::AbstractArray)
blocksizes(A::AbstractArray, i::Int)
Return the tuple of the sizes of blocks along each
dimension. See also size and blocksize.
Expand Down Expand Up @@ -340,8 +340,8 @@ Return the first index of each block of `a`.
# Examples
```jldoctest
julia> b = blockedrange(1:3)
3-blocked 6-element BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}:
julia> b = blockedrange([1,2,3])
3-blocked 6-element BlockedUnitRange{Vector{Int64}}:
1
2
Expand All @@ -366,8 +366,8 @@ Return the last index of each block of `a`.
# Examples
```jldoctest
julia> b = blockedrange(1:3)
3-blocked 6-element BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}:
julia> b = blockedrange([1,2,3])
3-blocked 6-element BlockedUnitRange{Vector{Int64}}:
1
2
Expand All @@ -378,7 +378,7 @@ julia> b = blockedrange(1:3)
6
julia> blocklasts(b)
3-element ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}:
3-element Vector{Int64}:
1
3
6
Expand All @@ -392,8 +392,8 @@ Return the length of each block of `a`.
# Examples
```jldoctest
julia> b = blockedrange(1:3)
3-blocked 6-element BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}:
julia> b = blockedrange([1,2,3])
3-blocked 6-element BlockedUnitRange{Vector{Int64}}:
1
2
Expand Down

0 comments on commit e0d9eca

Please sign in to comment.