JuliaArrays / JuliaArrays/BlockArrays.jl
Should `BlockArray(arr::AbstractArray{T,N},..)` always create a `BlockArray{T,N,Array{T}}`?
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 254
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
At the moment BlockArray(arr::AbstractArray{T,N},..) creates a BlockArray{T,N,typeof(arr)}. However, for many types subarrays are not of the same type (e.g., Diagonal). I think it is safer to always convert to Array.
The one argument I can see is that it might be nice for BlockArray(::SparseVector) to automatically use sparse data storage.
Another option is to look into whether the type of sub-blocks can be inferred automatically.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the BlockArray(arr::AbstractArray{T,N},..) constructor named in the issue and inspect how Diagonal and SparseVector subarrays are represented. Compare the proposed Array conversion with inferred sub-block types; done requires choosing and implementing one consistent storage policy, with behavior for both examples decided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100