Skip to content

Commit b604843

Browse files
authored
Merge pull request #50 from JuliaArrays/teh/v0.7
Require julia 0.7-beta
2 parents 97e945f + 84202c5 commit b604843

File tree

5 files changed

+71
-130
lines changed

5 files changed

+71
-130
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ os:
44
- linux
55

66
julia:
7-
- 0.6
87
- nightly
98

109
notifications:

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
julia 0.6
2-
Compat 0.45
1+
julia 0.7.0-beta.73

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
53
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
64
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
75

src/OffsetArrays.jl

Lines changed: 38 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,9 @@ __precompile__()
33
module OffsetArrays
44

55
using Base: Indices, tail
6-
using Compat
7-
using Compat: axes, CartesianIndices
86

97
export OffsetArray, OffsetVector, @unsafe
108

11-
## Major change in 0.7: OffsetArray now uses Offset axes
12-
const AxisType = VERSION < v"0.7.0-DEV.5242" ? identity : Base.Slice
13-
14-
# TODO: just use .+
15-
# See https://github.com/JuliaLang/julia/pull/22932#issuecomment-330711997
16-
if VERSION < v"0.7.0-DEV.1759"
17-
plus(r::AbstractUnitRange, i::Integer) = r + i
18-
else
19-
plus(r::AbstractUnitRange, i::Integer) = broadcast(+, r, i)
20-
end
21-
229
struct OffsetArray{T,N,AA<:AbstractArray} <: AbstractArray{T,N}
2310
parent::AA
2411
offsets::NTuple{N,Int}
@@ -31,7 +18,7 @@ OffsetArray(A::AbstractArray{T,N}, offsets::Vararg{Int,N}) where {T,N} =
3118
OffsetArray(A, offsets)
3219

3320
OffsetArray{T,N}(::UndefInitializer, inds::Indices{N}) where {T,N} =
34-
OffsetArray{T,N,Array{T,N}}(Array{T,N}(undef, map(length, inds)), map(indexoffset, inds))
21+
OffsetArray{T,N,Array{T,N}}(Array{T,N}(undef, map(indexlength, inds)), map(indexoffset, inds))
3522
OffsetArray{T}(::UndefInitializer, inds::Indices{N}) where {T,N} = OffsetArray{T,N}(undef, inds)
3623
OffsetArray{T,N}(::UndefInitializer, inds::Vararg{AbstractUnitRange,N}) where {T,N} = OffsetArray{T,N}(undef, inds)
3724
OffsetArray{T}(::UndefInitializer, inds::Vararg{AbstractUnitRange,N}) where {T,N} = OffsetArray{T,N}(undef, inds)
@@ -44,33 +31,13 @@ OffsetVector{T}(::UndefInitializer, inds::AbstractUnitRange) where {T} = OffsetA
4431
# deprecated constructors
4532
using Base: @deprecate
4633

47-
# https://github.com/JuliaLang/julia/pull/19989
48-
@static if isdefined(Base, :UndefInitializer)
49-
@deprecate OffsetArray(::Type{T}, inds::Vararg{UnitRange{Int},N}) where {T,N} OffsetArray{T}(undef, inds)
50-
@deprecate OffsetVector(::Type{T}, inds::AbstractUnitRange) where {T} OffsetVector{T}(undef, inds)
51-
else
52-
OffsetArray(::Type{T}, inds::Vararg{UnitRange{Int},N}) where {T,N} = OffsetArray{T}(inds)
53-
OffsetVector(::Type{T}, inds::AbstractUnitRange) where {T} = OffsetVector{T}(inds)
54-
end
55-
56-
# https://github.com/JuliaLang/julia/pull/24652
57-
# Only activate deprecation if `undef` is available from Base;
58-
# should not rely on the user having `undef` available from Compat
59-
# and OffsetArrays.jl should probably not re-export Compat.undef
60-
@static if isdefined(Base, :UndefInitializer)
61-
@deprecate OffsetArray{T,N}(inds::Indices{N}) where {T,N} OffsetArray{T,N}(undef, inds)
62-
@deprecate OffsetArray{T}(inds::Indices{N}) where {T,N} OffsetArray{T}(undef, inds)
63-
@deprecate OffsetArray{T,N}(inds::Vararg{AbstractUnitRange,N}) where {T,N} OffsetArray{T,N}(undef, inds)
64-
@deprecate OffsetArray{T}(inds::Vararg{AbstractUnitRange,N}) where {T,N} OffsetArray{T}(undef, inds)
65-
@deprecate OffsetVector{T}(inds::AbstractUnitRange) where {T} OffsetVector{T}(undef, inds)
66-
else
67-
OffsetArray{T,N}(inds::Indices{N}) where {T,N} = OffsetArray{T,N}(undef, inds)
68-
OffsetArray{T}(inds::Indices{N}) where {T,N} = OffsetArray{T}(undef, inds)
69-
OffsetArray{T,N}(inds::Vararg{AbstractUnitRange,N}) where {T,N} = OffsetArray{T,N}(undef, inds)
70-
OffsetArray{T}(inds::Vararg{AbstractUnitRange,N}) where {T,N} = OffsetArray{T}(undef, inds)
71-
OffsetVector{T}(inds::AbstractUnitRange) where {T} = OffsetVector{T}(undef, inds)
72-
end
73-
34+
@deprecate OffsetArray(::Type{T}, inds::Vararg{UnitRange{Int},N}) where {T,N} OffsetArray{T}(undef, inds)
35+
@deprecate OffsetVector(::Type{T}, inds::AbstractUnitRange) where {T} OffsetVector{T}(undef, inds)
36+
@deprecate OffsetArray{T,N}(inds::Indices{N}) where {T,N} OffsetArray{T,N}(undef, inds)
37+
@deprecate OffsetArray{T}(inds::Indices{N}) where {T,N} OffsetArray{T}(undef, inds)
38+
@deprecate OffsetArray{T,N}(inds::Vararg{AbstractUnitRange,N}) where {T,N} OffsetArray{T,N}(undef, inds)
39+
@deprecate OffsetArray{T}(inds::Vararg{AbstractUnitRange,N}) where {T,N} OffsetArray{T}(undef, inds)
40+
@deprecate OffsetVector{T}(inds::AbstractUnitRange) where {T} OffsetVector{T}(undef, inds)
7441

7542
# The next two are necessary for ambiguity resolution. Really, the
7643
# second method should not be necessary.
@@ -100,12 +67,12 @@ Base.eachindex(::IndexLinear, A::OffsetVector) = axes(A, 1)
10067
# Implementations of axes and indices1. Since bounds-checking is
10168
# performance-critical and relies on axes, these are usually worth
10269
# optimizing thoroughly.
103-
@inline Compat.axes(A::OffsetArray, d) =
104-
1 <= d <= length(A.offsets) ? AxisType(plus(axes(parent(A))[d], A.offsets[d])) : (1:1)
105-
@inline Compat.axes(A::OffsetArray) =
70+
@inline Base.axes(A::OffsetArray, d) =
71+
1 <= d <= length(A.offsets) ? Base.Slice(axes(parent(A))[d] .+ A.offsets[d]) : (1:1)
72+
@inline Base.axes(A::OffsetArray) =
10673
_axes(axes(parent(A)), A.offsets) # would rather use ntuple, but see #15276
10774
@inline _axes(inds, offsets) =
108-
(AxisType(plus(inds[1], offsets[1])), _axes(tail(inds), tail(offsets))...)
75+
(Base.Slice(inds[1] .+ offsets[1]), _axes(tail(inds), tail(offsets))...)
10976
_axes(::Tuple{}, ::Tuple{}) = ()
11077
Base.indices1(A::OffsetArray{T,0}) where {T} = 1:1 # we only need to specialize this one
11178

@@ -119,16 +86,6 @@ function Base.similar(A::AbstractArray, ::Type{T}, inds::Tuple{OffsetAxis,Vararg
11986
OffsetArray(B, map(indexoffset, inds))
12087
end
12188

122-
if VERSION < v"0.7.0-DEV.5242"
123-
# Reshape's methods in Base changed, so using the new definitions leads to ambiguities
124-
Base.reshape(A::AbstractArray, inds::Tuple{UnitRange,Vararg{UnitRange}}) =
125-
OffsetArray(reshape(A, map(length, inds)), map(indexoffset, inds))
126-
Base.reshape(A::OffsetArray, inds::Tuple{UnitRange,Vararg{UnitRange}}) =
127-
OffsetArray(reshape(parent(A), map(length, inds)), map(indexoffset, inds))
128-
function Base.reshape(A::OffsetArray, inds::Tuple{UnitRange,Vararg{Union{UnitRange,Int,Base.OneTo}}})
129-
throw(ArgumentError("reshape must supply UnitRange axes, got $(typeof(inds)).\n Note that reshape(A, Val{N}) is not supported for OffsetArrays."))
130-
end
131-
else
13289
Base.reshape(A::AbstractArray, inds::Tuple{OffsetAxis,Vararg{OffsetAxis}}) =
13390
OffsetArray(reshape(A, map(indexlength, inds)), map(indexoffset, inds))
13491

@@ -139,30 +96,20 @@ Base.reshape(A::OffsetArray, inds::Tuple{OffsetAxis,Vararg{OffsetAxis}}) =
13996
# And for non-offset axes, we can just return a reshape of the parent directly
14097
Base.reshape(A::OffsetArray, inds::Tuple{Union{Integer,Base.OneTo},Vararg{Union{Integer,Base.OneTo}}}) = reshape(parent(A), inds)
14198
Base.reshape(A::OffsetArray, inds::Dims) = reshape(parent(A), inds)
142-
end
14399

144-
if VERSION < v"0.7.0-DEV.4873"
145-
# Julia PR #26733 removed similar(f, ...) in favor of just using method extension directly
146-
# https://github.com/JuliaLang/julia/pull/26733
147-
Base.similar(::Type{T}, shape::Tuple{UnitRange,Vararg{UnitRange}}) where {T<:AbstractArray} =
148-
OffsetArray(T(undef, map(indexlength, shape)), map(indexoffset, shape))
149-
Base.similar(f::Function, shape::Tuple{UnitRange,Vararg{UnitRange}}) =
150-
OffsetArray(f(map(indexlength, shape)), map(indexoffset, shape))
151-
else
152-
Base.similar(::Type{T}, shape::Tuple{OffsetAxis,Vararg{OffsetAxis}}) where {T<:AbstractArray} =
153-
OffsetArray(T(undef, map(indexlength, shape)), map(indexoffset, shape))
154-
155-
Base.fill(v, inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {N} =
156-
fill!(OffsetArray(Array{typeof(v), N}(undef, map(indexlength, inds)), map(indexoffset, inds)), v)
157-
Base.zeros(::Type{T}, inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {T, N} =
158-
fill!(OffsetArray(Array{T, N}(undef, map(indexlength, inds)), map(indexoffset, inds)), zero(T))
159-
Base.ones(::Type{T}, inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {T, N} =
160-
fill!(OffsetArray(Array{T, N}(undef, map(indexlength, inds)), map(indexoffset, inds)), one(T))
161-
Base.trues(inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {N} =
162-
fill!(OffsetArray(BitArray{N}(undef, map(indexlength, inds)), map(indexoffset, inds)), true)
163-
Base.falses(inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {N} =
164-
fill!(OffsetArray(BitArray{N}(undef, map(indexlength, inds)), map(indexoffset, inds)), false)
165-
end
100+
Base.similar(::Type{T}, shape::Tuple{OffsetAxis,Vararg{OffsetAxis}}) where {T<:AbstractArray} =
101+
OffsetArray(T(undef, map(indexlength, shape)), map(indexoffset, shape))
102+
103+
Base.fill(v, inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {N} =
104+
fill!(OffsetArray(Array{typeof(v), N}(undef, map(indexlength, inds)), map(indexoffset, inds)), v)
105+
Base.zeros(::Type{T}, inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {T, N} =
106+
fill!(OffsetArray(Array{T, N}(undef, map(indexlength, inds)), map(indexoffset, inds)), zero(T))
107+
Base.ones(::Type{T}, inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {T, N} =
108+
fill!(OffsetArray(Array{T, N}(undef, map(indexlength, inds)), map(indexoffset, inds)), one(T))
109+
Base.trues(inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {N} =
110+
fill!(OffsetArray(BitArray{N}(undef, map(indexlength, inds)), map(indexoffset, inds)), true)
111+
Base.falses(inds::NTuple{N, Union{Integer, AbstractUnitRange}}) where {N} =
112+
fill!(OffsetArray(BitArray{N}(undef, map(indexlength, inds)), map(indexoffset, inds)), false)
166113

167114
# Don't allow bounds-checks to be removed during Julia 0.5
168115
@inline function Base.getindex(A::OffsetArray{T,N}, I::Vararg{Int,N}) where {T,N}
@@ -293,22 +240,20 @@ end
293240
@inline unsafe_getindex(a::OffsetSubArray, I::Union{Integer,CartesianIndex}...) = unsafe_getindex(a, Base.IteratorsMD.flatten(I)...)
294241
@inline unsafe_setindex!(a::OffsetSubArray, val, I::Union{Integer,CartesianIndex}...) = unsafe_setindex!(a, val, Base.IteratorsMD.flatten(I)...)
295242

296-
if VERSION >= v"0.7.0-DEV.1790"
297-
function Base.showarg(io::IO, a::OffsetArray, toplevel)
298-
print(io, "OffsetArray(")
299-
Base.showarg(io, parent(a), false)
300-
if ndims(a) > 0
301-
print(io, ", ")
302-
printindices(io, axes(a)...)
303-
end
304-
print(io, ')')
305-
toplevel && print(io, " with eltype ", eltype(a))
243+
function Base.showarg(io::IO, a::OffsetArray, toplevel)
244+
print(io, "OffsetArray(")
245+
Base.showarg(io, parent(a), false)
246+
if ndims(a) > 0
247+
print(io, ", ")
248+
printindices(io, axes(a)...)
306249
end
307-
printindices(io::IO, ind1, inds...) =
308-
(print(io, _unslice(ind1), ", "); printindices(io, inds...))
309-
printindices(io::IO, ind1) = print(io, _unslice(ind1))
310-
_unslice(x) = x
311-
_unslice(x::Base.Slice) = x.indices
250+
print(io, ')')
251+
toplevel && print(io, " with eltype ", eltype(a))
312252
end
253+
printindices(io::IO, ind1, inds...) =
254+
(print(io, _unslice(ind1), ", "); printindices(io, inds...))
255+
printindices(io::IO, ind1) = print(io, _unslice(ind1))
256+
_unslice(x) = x
257+
_unslice(x::Base.Slice) = x.indices
313258

314259
end # module

test/runtests.jl

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
using Compat.Test
21
using OffsetArrays
3-
using Compat
4-
using Compat: axes, CartesianIndices, copyto!
5-
using Compat.DelimitedFiles
2+
using Test
3+
using DelimitedFiles
64

75
@test isempty(detect_ambiguities(OffsetArrays, Base, Core))
86

@@ -36,6 +34,9 @@ y = OffsetArray(r, r)
3634
y = OffsetArray(r, (r,))
3735
@test axes(y) == (r,)
3836

37+
y = OffsetArray{Float32}(undef, (Base.Slice(-1:1),))
38+
@test axes(y) === (Base.Slice(-1:1),)
39+
3940
A0 = [1 3; 2 4]
4041
A = OffsetArray(A0, (-1,2)) # IndexLinear
4142
S = OffsetArray(view(A0, 1:2, 1:2), (-1,2)) # IndexCartesian
@@ -97,19 +98,18 @@ Ac[0,3,1] = 11
9798
@test eachindex(S) == CartesianIndices(Base.Slice.((0:1,3:4)))
9899

99100
# view
100-
const AxisType = VERSION < v"0.7.0-DEV.5242" ? identity : Base.Slice
101101
S = view(A, :, 3)
102102
@test S == OffsetArray([1,2], (A.offsets[1],))
103103
@test S[0] == 1
104104
@test S[1] == 2
105105
@test_throws BoundsError S[2]
106-
@test axes(S) === (AxisType(0:1),)
106+
@test axes(S) === (Base.Slice(0:1),)
107107
S = view(A, 0, :)
108108
@test S == OffsetArray([1,3], (A.offsets[2],))
109109
@test S[3] == 1
110110
@test S[4] == 3
111111
@test_throws BoundsError S[1]
112-
@test axes(S) === (AxisType(3:4),)
112+
@test axes(S) === (Base.Slice(3:4),)
113113
S = view(A, 0:0, 4)
114114
@test S == [3]
115115
@test S[1] == 3
@@ -128,7 +128,7 @@ S = view(A, :, :)
128128
@test S[0,4] == S[3] == 3
129129
@test S[1,4] == S[4] == 4
130130
@test_throws BoundsError S[1,1]
131-
@test axes(S) === AxisType.((0:1, 3:4))
131+
@test axes(S) === Base.Slice.((0:1, 3:4))
132132

133133
# iteration
134134
let a
@@ -169,10 +169,10 @@ B = similar(A, (3,4))
169169
@test axes(B) === (Base.OneTo(3), Base.OneTo(4))
170170
B = similar(A, (-3:3,1:4))
171171
@test isa(B, OffsetArray{Int,2})
172-
@test axes(B) === AxisType.((-3:3, 1:4))
172+
@test axes(B) === Base.Slice.((-3:3, 1:4))
173173
B = similar(parent(A), (-3:3,1:4))
174174
@test isa(B, OffsetArray{Int,2})
175-
@test axes(B) === AxisType.((-3:3, 1:4))
175+
@test axes(B) === Base.Slice.((-3:3, 1:4))
176176
@test isa([x for x in [1,2,3]], Vector{Int})
177177
@test similar(Array{Int}, (0:0, 0:0)) isa OffsetArray{Int, 2}
178178
@test similar(Array{Int}, (1, 1)) isa Matrix{Int}
@@ -185,13 +185,13 @@ end
185185
B = reshape(A0, -10:-9, 9:10)
186186
@test isa(B, OffsetArray{Int,2})
187187
@test parent(B) === A0
188-
@test axes(B) == AxisType.((-10:-9, 9:10))
188+
@test axes(B) == Base.Slice.((-10:-9, 9:10))
189189
B = reshape(A, -10:-9, 9:10)
190190
@test isa(B, OffsetArray{Int,2})
191191
@test pointer(parent(B)) === pointer(A0)
192-
@test axes(B) == AxisType.((-10:-9, 9:10))
192+
@test axes(B) == Base.Slice.((-10:-9, 9:10))
193193
b = reshape(A, -7:-4)
194-
@test axes(b) == (AxisType(-7:-4),)
194+
@test axes(b) == (Base.Slice(-7:-4),)
195195
@test isa(parent(b), Vector{Int})
196196
@test pointer(parent(b)) === pointer(parent(A))
197197
@test parent(b) == A0[:]
@@ -201,28 +201,28 @@ if VERSION >= v"0.7.0-DEV.5242"
201201
b = reshape(a, Val(2))
202202
@test isa(b, OffsetArray{Float64,2})
203203
@test pointer(parent(b)) === pointer(parent(a))
204-
@test axes(b) == AxisType.((-1:1, 1:9))
204+
@test axes(b) == Base.Slice.((-1:1, 1:9))
205205
b = reshape(a, Val(4))
206206
@test isa(b, OffsetArray{Float64,4})
207207
@test pointer(parent(b)) === pointer(parent(a))
208-
@test axes(b) == (axes(a)..., AxisType(1:1))
208+
@test axes(b) == (axes(a)..., Base.Slice(1:1))
209209
end
210210

211211
# Indexing with OffsetArray axes
212212
i1 = OffsetArray([2,1], (-5,))
213213
i1 = OffsetArray([2,1], -5)
214214
b = A0[i1, 1]
215-
@test axes(b) === (AxisType(-4:-3),)
215+
@test axes(b) === (Base.Slice(-4:-3),)
216216
@test b[-4] == 2
217217
@test b[-3] == 1
218218
b = A0[1,i1]
219-
@test axes(b) === (AxisType(-4:-3),)
219+
@test axes(b) === (Base.Slice(-4:-3),)
220220
@test b[-4] == 3
221221
@test b[-3] == 1
222222
v = view(A0, i1, 1)
223-
@test axes(v) === (AxisType(-4:-3),)
223+
@test axes(v) === (Base.Slice(-4:-3),)
224224
v = view(A0, 1:1, i1)
225-
@test axes(v) === (Base.OneTo(1), AxisType(-4:-3))
225+
@test axes(v) === (Base.OneTo(1), Base.Slice(-4:-3))
226226

227227
# logical indexing
228228
@test A[A .> 2] == [3,4]
@@ -293,17 +293,17 @@ A = OffsetArray(rand(4,4), (-3,5))
293293
@test minimum(A) == minimum(parent(A))
294294
@test extrema(A) == extrema(parent(A))
295295
C = similar(A)
296-
Compat.cumsum!(C, A, dims = 1)
297-
@test parent(C) == Compat.cumsum(parent(A), dims = 1)
298-
@test parent(Compat.cumsum(A, dims = 1)) == Compat.cumsum(parent(A), dims = 1)
299-
Compat.cumsum!(C, A, dims = 2)
300-
@test parent(C) == Compat.cumsum(parent(A), dims = 2)
296+
cumsum!(C, A, dims = 1)
297+
@test parent(C) == cumsum(parent(A), dims = 1)
298+
@test parent(cumsum(A, dims = 1)) == cumsum(parent(A), dims = 1)
299+
cumsum!(C, A, dims = 2)
300+
@test parent(C) == cumsum(parent(A), dims = 2)
301301
R = similar(A, (1:1, 6:9))
302302
maximum!(R, A)
303-
@test parent(R) == Compat.maximum(parent(A), dims = 1)
303+
@test parent(R) == maximum(parent(A), dims = 1)
304304
R = similar(A, (-2:1, 1:1))
305305
maximum!(R, A)
306-
@test parent(R) == Compat.maximum(parent(A), dims = 2)
306+
@test parent(R) == maximum(parent(A), dims = 2)
307307
amin, iamin = findmin(A)
308308
pmin, ipmin = findmin(parent(A))
309309
@test amin == pmin
@@ -340,16 +340,16 @@ v = OffsetArray(rand(8), (-2,))
340340
@test sort(v) == OffsetArray(sort(parent(v)), v.offsets)
341341
@test sortrows(A) == OffsetArray(sortrows(parent(A)), A.offsets)
342342
@test sortcols(A) == OffsetArray(sortcols(parent(A)), A.offsets)
343-
@test Compat.sort(A, dims = 1) == OffsetArray(Compat.sort(parent(A), dims = 1), A.offsets)
344-
@test Compat.sort(A, dims = 2) == OffsetArray(Compat.sort(parent(A), dims = 2), A.offsets)
343+
@test sort(A, dims = 1) == OffsetArray(sort(parent(A), dims = 1), A.offsets)
344+
@test sort(A, dims = 2) == OffsetArray(sort(parent(A), dims = 2), A.offsets)
345345

346-
@test mapslices(v->sort(v), A, 1) == OffsetArray(mapslices(v->sort(v), parent(A), 1), A.offsets)
347-
@test mapslices(v->sort(v), A, 2) == OffsetArray(mapslices(v->sort(v), parent(A), 2), A.offsets)
346+
@test mapslices(v->sort(v), A, dims = 1) == OffsetArray(mapslices(v->sort(v), parent(A), dims = 1), A.offsets)
347+
@test mapslices(v->sort(v), A, dims = 2) == OffsetArray(mapslices(v->sort(v), parent(A), dims = 2), A.offsets)
348348

349349
@test rotl90(A) == OffsetArray(rotl90(parent(A)), A.offsets[[2,1]])
350350
@test rotr90(A) == OffsetArray(rotr90(parent(A)), A.offsets[[2,1]])
351-
@test Compat.reverse(A, dims = 1) == OffsetArray(Compat.reverse(parent(A), dims = 1), A.offsets)
352-
@test Compat.reverse(A, dims = 2) == OffsetArray(Compat.reverse(parent(A), dims = 2), A.offsets)
351+
@test reverse(A, dims = 1) == OffsetArray(reverse(parent(A), dims = 1), A.offsets)
352+
@test reverse(A, dims = 2) == OffsetArray(reverse(parent(A), dims = 2), A.offsets)
353353

354354
@test A.+1 == OffsetArray(parent(A).+1, A.offsets)
355355
@test 2*A == OffsetArray(2*parent(A), A.offsets)

0 commit comments

Comments
 (0)