Skip to content

Commit

Permalink
[WIP] [BlockSparseArrays] Redesign nested views
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Jun 19, 2024
1 parent 7b2ada9 commit 4a22837
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 147 deletions.
147 changes: 0 additions & 147 deletions NDTensors/src/lib/BlockSparseArrays/test/backup/runtests.jl

This file was deleted.

7 changes: 7 additions & 0 deletions NDTensors/src/lib/BlockSparseArrays/test/test_basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,23 @@ include("TestBlockSparseArraysUtils.jl")

a = BlockSparseArray{elt}([2, 3], [3, 4])
b = @view a[[Block(2), Block(1)], [Block(2), Block(1)]]
@test b isa SubArray{<:Any,<:Any,<:BlockSparseArray}
@test_broken b[2:4, 2:4]

a = BlockSparseArray{elt}([2, 3], [3, 4])
b = @views a[[Block(2), Block(1)], [Block(2), Block(1)]][Block(1, 1)]
@test_broken b isa SubArray{<:Any,<:Any,<:BlockSparseArray}

a = BlockSparseArray{elt}([2, 3], [3, 4])
b = @views a[Block(1, 1)][1:2, 1:1]
@test b isa SubArray{<:Any,<:Any,<:BlockSparseArray}
for i in parentindices(b)
@test_broken i isa BlockSlice{<:BlockIndexRange{1}}
end

a = BlockSparseArray{elt}([2, 3], [3, 4])
b = @view a[[Block(2), Block(1)], [Block(2), Block(1)]]
@test b isa SubArray{<:Any,<:Any,<:BlockSparseArray}
@test_broken b[Block(1, 1)] = randn(3, 3)
end
@testset "Basics" begin
Expand Down

0 comments on commit 4a22837

Please sign in to comment.