Skip to content

Commit cf07c4c

Browse files
committed
Replace all use of 'indexes' with 'indices'
1 parent 5a2ef5f commit cf07c4c

37 files changed

+192
-188
lines changed

base/abstractarray.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,22 +1879,22 @@ function mapslices(f, A::AbstractArray, dims::AbstractVector)
18791879
R[ridx...] = r1
18801880

18811881
nidx = length(otherdims)
1882-
indexes = Iterators.drop(CartesianRange(itershape), 1)
1883-
inner_mapslices!(safe_for_reuse, indexes, nidx, idx, otherdims, ridx, Aslice, A, f, R)
1882+
indices = Iterators.drop(CartesianRange(itershape), 1)
1883+
inner_mapslices!(safe_for_reuse, indices, nidx, idx, otherdims, ridx, Aslice, A, f, R)
18841884
end
18851885

1886-
@noinline function inner_mapslices!(safe_for_reuse, indexes, nidx, idx, otherdims, ridx, Aslice, A, f, R)
1886+
@noinline function inner_mapslices!(safe_for_reuse, indices, nidx, idx, otherdims, ridx, Aslice, A, f, R)
18871887
if safe_for_reuse
18881888
# when f returns an array, R[ridx...] = f(Aslice) line copies elements,
18891889
# so we can reuse Aslice
1890-
for I in indexes # skip the first element, we already handled it
1890+
for I in indices # skip the first element, we already handled it
18911891
replace_tuples!(nidx, idx, ridx, otherdims, I)
18921892
_unsafe_getindex!(Aslice, A, idx...)
18931893
R[ridx...] = f(Aslice)
18941894
end
18951895
else
18961896
# we can't guarantee safety (#18524), so allocate new storage for each slice
1897-
for I in indexes
1897+
for I in indices
18981898
replace_tuples!(nidx, idx, ridx, otherdims, I)
18991899
R[ridx...] = f(A[idx...])
19001900
end

base/array.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ findlast(testf::Function, A) = findprev(testf, A, endof(A))
16781678
"""
16791679
find(f::Function, A)
16801680
1681-
Return a vector `I` of the linear indexes of `A` where `f(A[I])` returns `true`.
1681+
Return a vector `I` of the linear indices of `A` where `f(A[I])` returns `true`.
16821682
If there are no such elements of `A`, return an empty array.
16831683
16841684
# Examples
@@ -1705,7 +1705,7 @@ julia> find(isodd, [2, 4])
17051705
```
17061706
"""
17071707
function find(testf::Function, A)
1708-
# use a dynamic-length array to store the indexes, then copy to a non-padded
1708+
# use a dynamic-length array to store the indices, then copy to a non-padded
17091709
# array for the return
17101710
tmpI = Vector{Int}()
17111711
inds = _index_remapper(A)
@@ -1770,7 +1770,7 @@ findn(A::AbstractVector) = find(A)
17701770
"""
17711771
findn(A)
17721772
1773-
Return a vector of indexes for each dimension giving the locations of the non-zeros in `A`
1773+
Return a vector of indices for each dimension giving the locations of the non-zeros in `A`
17741774
(determined by `A[i]!=0`).
17751775
If there are no non-zero elements of `A`, return a 2-tuple of empty arrays.
17761776
@@ -1812,7 +1812,7 @@ end
18121812
"""
18131813
findnz(A)
18141814
1815-
Return a tuple `(I, J, V)` where `I` and `J` are the row and column indexes of the non-zero
1815+
Return a tuple `(I, J, V)` where `I` and `J` are the row and column indices of the non-zero
18161816
values in matrix `A`, and `V` is a vector of the non-zero values.
18171817
18181818
# Examples

base/asyncmap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function start(itr::AsyncCollector)
313313
itr.batch_size = verify_batch_size(itr.batch_size)
314314
if itr.batch_size !== nothing
315315
exec_func = batch -> begin
316-
# extract indexes from the input tuple
316+
# extract indices from the input tuple
317317
batch_idxs = map(x->x[1], batch)
318318

319319
# and the args tuple....

base/bitarray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ end
12771277

12781278
function reverse!(B::BitVector)
12791279
# Basic idea: each chunk is divided into two blocks of size k = n % 64, and
1280-
# h = 64 - k. Walk from either end (with indexes i and j) reversing chunks
1280+
# h = 64 - k. Walk from either end (with indices i and j) reversing chunks
12811281
# and separately ORing their two blocks into place.
12821282
#
12831283
# chunk 3 chunk 2 chunk 1

base/deprecated.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function convert(::Type{UpperTriangular}, A::Bidiagonal)
215215
end
216216

217217
# Deprecate three-arg SubArray since the constructor doesn't need the dims tuple
218-
@deprecate SubArray(parent::AbstractArray, indexes::Tuple, dims::Tuple) SubArray(parent, indexes)
218+
@deprecate SubArray(parent::AbstractArray, indices::Tuple, dims::Tuple) SubArray(parent, indices)
219219

220220
# Deprecate vectorized unary functions over sparse matrices in favor of compact broadcast syntax (#17265).
221221
for f in (:sind, :asind, :tand, :atand, :sinpi, :cosc, :ceil, :floor, :trunc,
@@ -3037,6 +3037,9 @@ end
30373037
@deprecate lpad(s, n::Integer, p) lpad(string(s), n, string(p))
30383038
@deprecate rpad(s, n::Integer, p) rpad(string(s), n, string(p))
30393039

3040+
# Issue #12902
3041+
@deprecate parentindexes parentindices
3042+
30403043
# END 0.7 deprecations
30413044

30423045
# BEGIN 1.0 deprecations

base/dict.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ mutable struct Dict{K,V} <: AbstractDict{K,V}
9696
ndel::Int
9797
count::Int
9898
age::UInt
99-
idxfloor::Int # an index <= the indexes of all used slots
99+
idxfloor::Int # an index <= the indices of all used slots
100100
maxprobe::Int
101101

102102
function Dict{K,V}() where V where K

base/exports.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ export
478478
nonzeros,
479479
ones,
480480
parent,
481-
parentindexes,
481+
parentindices,
482482
partialsort,
483483
partialsort!,
484484
partialsortperm,

base/intfuncs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ bitstring(x::Union{Int128,UInt128}) = bin(reinterpret(UInt128,x),128)
752752
753753
Return an array with element type `T` (default `Int`) of the digits of `n` in the given
754754
base, optionally padded with zeros to a specified size. More significant digits are at
755-
higher indexes, such that `n == sum([digits[k]*base^(k-1) for k=1:length(digits)])`.
755+
higher indices, such that `n == sum([digits[k]*base^(k-1) for k=1:length(digits)])`.
756756
757757
# Examples
758758
```jldoctest
@@ -796,7 +796,7 @@ hastypemax(::Type{T}) where {T} = applicable(typemax, T)
796796
digits!(array, n::Integer, base::Integer=10)
797797
798798
Fills an array of the digits of `n` in the given base. More significant digits are at higher
799-
indexes. If the array length is insufficient, the least significant digits are filled up to
799+
indices. If the array length is insufficient, the least significant digits are filled up to
800800
the array length. If the array length is excessive, the excess portion is filled with zeros.
801801
802802
# Examples

base/multidimensional.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ index_lengths() = ()
431431
@inline index_lengths(A::AbstractArray, rest...) = (length(A), index_lengths(rest...)...)
432432
@inline index_lengths(A::Slice, rest...) = (length(indices1(A)), index_lengths(rest...)...)
433433

434-
# shape of array to create for getindex() with indexes I, dropping scalars
434+
# shape of array to create for getindex() with indices I, dropping scalars
435435
# returns a Tuple{Vararg{AbstractUnitRange}} of indices
436436
index_shape() = ()
437437
@inline index_shape(::Real, rest...) = index_shape(rest...)

base/repl/LineEdit.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ region(s) = Pair(extrema(_region(s))...)
106106

107107
bufend(s) = buffer(s).size
108108

109-
indexes(reg::Region) = first(reg)+1:last(reg)
109+
indices(reg::Region) = first(reg)+1:last(reg)
110110

111-
content(s, reg::Region = 0=>bufend(s)) = String(buffer(s).data[indexes(reg)])
111+
content(s, reg::Region = 0=>bufend(s)) = String(buffer(s).data[indices(reg)])
112112

113113
function activate_region(s::PromptState, state::Symbol)
114114
@assert state in (:mark, :shift, :off)

0 commit comments

Comments
 (0)