JuliaArrays / JuliaArrays/BlockArrays.jl
mortar is too restrictive about `ndims`
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 254
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
This error seems unnecessary;
julia> mortar([[1,2] [3,4]])
ERROR: All blocks must have ndims consistent with ndims = 2 of `blocks` array.
Stacktrace:
[1] sizes_from_blocks(::Array{Int64,2}) at /Users/solver/Projects/BlockArrays.jl/src/blockarray.jl:241
[2] mortar(::Array{Int64,2}) at /Users/solver/Projects/BlockArrays.jl/src/blockarray.jl:234
[3] top-level scope at none:0
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 in src/blockarray.jl at mortar and sizes_from_blocks, especially the reported lines 234 and 241. Reproduce mortar([[1,2] [3,4]]) and inspect why the ndims consistency check rejects it. Done means this example no longer raises the reported unnecessary error, with existing behavior preserved for genuinely inconsistent blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100