Skip to content

Commit 9ecb292

Browse files
committed
Try fixing tests
1 parent 04113e7 commit 9ecb292

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/wrappers.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,16 @@ function eachstoredparentindex(a::SubArray)
7070
return all(d -> I[d] parentindices(a)[d], 1:ndims(parent(a)))
7171
end
7272
end
73-
function index_to_parentindex(a::SubArray{<:Any,N}, I::CartesianIndex{N}) where {N}
73+
# Don't constrain the number of dimensions of the array
74+
# and index since the parent array can have a different
75+
# number of dimensions than the `SubArray`.
76+
function index_to_parentindex(a::SubArray, I::CartesianIndex)
7477
return CartesianIndex(Base.reindex(parentindices(a), Tuple(I)))
7578
end
76-
function parentindex_to_index(a::SubArray{<:Any,N}, I::CartesianIndex{N}) where {N}
79+
# Don't constrain the number of dimensions of the array
80+
# and index since the parent array can have a different
81+
# number of dimensions than the `SubArray`.
82+
function parentindex_to_index(a::SubArray, I::CartesianIndex)
7783
nonscalardims = filter(tuple_oneto(ndims(parent(a)))) do d
7884
return !(parentindices(a)[d] isa Real)
7985
end

0 commit comments

Comments
 (0)