Skip to content

Commit 9f06021

Browse files
Add issparse method for AbstractVectorOfArray
Fixes #486 When issparse(::SubArray) is called, it tries to call issparse on the parent array. If the parent is an AbstractVectorOfArray, there was no issparse method defined, causing a MethodError. This commit adds issparse method that returns false for AbstractVectorOfArray, since it is not a sparse array type. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 537a78e commit 9f06021

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/RecursiveArrayToolsSparseArraysExt.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ function Base.copyto!(
1818
dest
1919
end
2020

21+
# Fix for issue #486: Define issparse for AbstractVectorOfArray
22+
# AbstractVectorOfArray is not a sparse array type, so it should return false
23+
SparseArrays.issparse(::RecursiveArrayTools.AbstractVectorOfArray) = false
24+
2125
end

0 commit comments

Comments
 (0)