JuliaArrays / JuliaArrays/BlockArrays.jl
Structure of blocks matrix lost on broadcast or `similar`
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 254
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
using BlocksArrays, NamedArrays
m1 = mortar(NamedArray([rand(i,j) for i=1:2, j=1:3], (x=["a","b"], y=["c","d","e"])))
m2 = mortar(NamedArray([rand(i,j) for i=1:2, j=1:3], (x=["a","b"], y=["c","d","e"])))
m1 .* m2 # 2×3-blocked 3×6 BlockMatrix{Float64}
The result does not have the named blocks of the original matrices (although NamedArray itself preserves names on broadcast).
similar(m1) also has the blocks but not the names, which I guess might be the source of the problem?
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 by running the reproduction in the issue for m1 .* m2 and similar(m1), then trace the broadcast and similar entry points that construct the result. Compare their block structure and names with the original NamedArray inputs; done means both operations retain the named block structure described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100