Skip to content

Commit e0d9eca

Browse files
authored
Simplify and specify types in blockedrange-related docstrings (#342)
1 parent ea33af1 commit e0d9eca

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/blockaxis.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Base.unitrange(b::BlockedUnitRange) = first(b):last(b)
130130
Base.promote_rule(::Type{BlockedUnitRange{CS}}, ::Type{Base.OneTo{Int}}) where CS = UnitRange{Int}
131131

132132
"""
133-
blockaxes(A)
133+
blockaxes(A::AbstractArray)
134134
135135
Return the tuple of valid block indices for array `A`.
136136
@@ -163,13 +163,13 @@ _blockaxes(b::Tuple) = (Block.(Base.OneTo(length(b))),)
163163
blockaxes(b) = blockaxes.(axes(b), 1)
164164

165165
"""
166-
blockaxes(A, d)
166+
blockaxes(A::AbstractArray, d::Int)
167167
168168
Return the valid range of block indices for array `A` along dimension `d`.
169169
170170
# Examples
171171
```jldoctest
172-
julia> A = BlockArray([1,2,3],[2,1])
172+
julia> A = BlockArray([1,2,3], [2,1])
173173
2-blocked 3-element BlockVector{Int64}:
174174
1
175175
2
@@ -190,8 +190,8 @@ julia> blockaxes(A,1) |> collect
190190
end
191191

192192
"""
193-
blocksize(A)
194-
blocksize(A,i)
193+
blocksize(A::AbstractArray)
194+
blocksize(A::AbstractArray, i::Int)
195195
196196
Return the tuple of the number of blocks along each
197197
dimension. See also size and blocksizes.
@@ -217,8 +217,8 @@ blocksize(A,i) = length(blockaxes(A,i))
217217
@inline blocklength(t) = prod(blocksize(t))
218218

219219
"""
220-
blocksizes(A)
221-
blocksizes(A,i)
220+
blocksizes(A::AbstractArray)
221+
blocksizes(A::AbstractArray, i::Int)
222222
223223
Return the tuple of the sizes of blocks along each
224224
dimension. See also size and blocksize.
@@ -340,8 +340,8 @@ Return the first index of each block of `a`.
340340
341341
# Examples
342342
```jldoctest
343-
julia> b = blockedrange(1:3)
344-
3-blocked 6-element BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}:
343+
julia> b = blockedrange([1,2,3])
344+
3-blocked 6-element BlockedUnitRange{Vector{Int64}}:
345345
1
346346
347347
2
@@ -366,8 +366,8 @@ Return the last index of each block of `a`.
366366
367367
# Examples
368368
```jldoctest
369-
julia> b = blockedrange(1:3)
370-
3-blocked 6-element BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}:
369+
julia> b = blockedrange([1,2,3])
370+
3-blocked 6-element BlockedUnitRange{Vector{Int64}}:
371371
1
372372
373373
2
@@ -378,7 +378,7 @@ julia> b = blockedrange(1:3)
378378
6
379379
380380
julia> blocklasts(b)
381-
3-element ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}:
381+
3-element Vector{Int64}:
382382
1
383383
3
384384
6
@@ -392,8 +392,8 @@ Return the length of each block of `a`.
392392
393393
# Examples
394394
```jldoctest
395-
julia> b = blockedrange(1:3)
396-
3-blocked 6-element BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}:
395+
julia> b = blockedrange([1,2,3])
396+
3-blocked 6-element BlockedUnitRange{Vector{Int64}}:
397397
1
398398
399399
2

0 commit comments

Comments
 (0)