Skip to content

Commit 1e47d75

Browse files
committed
Try fixing tests
1 parent 1ea6c94 commit 1e47d75

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/BlockArraysExtensions/BlockArraysExtensions.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,6 @@ function blockrange(axis::AbstractUnitRange, r::Int)
290290
return error("Slicing with integer values isn't supported.")
291291
end
292292

293-
function blockrange(axis::AbstractUnitRange, r::AbstractVector{<:Block{1}})
294-
for b in r
295-
@assert b blockaxes(axis, 1)
296-
end
297-
return r
298-
end
299-
300293
# This handles changing the blocking, for example:
301294
# a = BlockSparseArray{Float64}([2, 2, 2, 2], [2, 2, 2, 2])
302295
# I = blockedrange([4, 4])
@@ -315,13 +308,20 @@ end
315308
# I = BlockedVector([Block(4), Block(3), Block(2), Block(1)], [2, 2])
316309
# I = BlockVector([Block(4), Block(3), Block(2), Block(1)], [2, 2])
317310
# a[I, I]
318-
function blockrange(axis::BlockedOneTo{<:Integer}, r::AbstractBlockVector{<:Block{1}})
311+
function blockrange(axis::AbstractUnitRange, r::AbstractBlockVector{<:Block{1}})
319312
for b in r
320313
@assert b blockaxes(axis, 1)
321314
end
322315
return only(blockaxes(r))
323316
end
324317

318+
function blockrange(axis::AbstractUnitRange, r::AbstractVector{<:Block{1}})
319+
for b in r
320+
@assert b blockaxes(axis, 1)
321+
end
322+
return r
323+
end
324+
325325
using BlockArrays: BlockSlice
326326
function blockrange(axis::AbstractUnitRange, r::BlockSlice)
327327
return blockrange(axis, r.block)

0 commit comments

Comments
 (0)