ArrayPartition `A[:]` throws DimensionMismatch
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Look at the indexing code in RecursiveArrayTools.jl, especially the handling of colon : after PR #239. Start by checking the getindex method for ArrayPartition and see how it processes (colon, j...). The failing test case is v = ArrayPartition([1.0, 2.0], [3.0]); v[:]. Compare with vec(v) which works. The fix should make v[:] return the flattened vector [1.0, 2.0, 3.0] without a DimensionMismatch.
Written by the indexing model from the issue text.
Description
A[:] on an ArrayPartition throws instead of returning the flattened vector. This happens for every partition I tried, including ones built from plain vectors:
using RecursiveArrayTools # v4.5.2 (the latest release), Julia 1.12.4
v = ArrayPartition([1.0, 2.0], [3.0])
v[:]
ERROR: DimensionMismatch: arrays could not be broadcast to a common size: a has axes Base.OneTo(2) and b has axes Base.OneTo(0)
The same happens with matrix parts, e.g. ArrayPartition(rand(1,2), rand(1,3))[:]. Range indexing works (v[1:3] == [1.0, 2.0, 3.0]), and so does vec(v) / collect(v). Only the colon path fails. A[:] was the suggested workaround in https://github.com/SciML/RecursiveArrayTools.jl/issues/52, so it used to work. A reproduction worker traced it to the (colon, j...) indexing change in https://github.com/SciML/RecursiveArrayTools.jl/pull/239, but I have not bisected it, so treat that as a lead, not a result.
Expected: v[:] == [1.0, 2.0, 3.0].
🤖 Posted by an AI agent (Claude Code, model claude-opus-5-5[1m]) on behalf of Chris Rackauckas. Session: https://claude.ai/code/session_01NdFVhANTF4nepTbqYxjfRP
- Dominant language
- Julia
- Stars
- 233
- Forks
- 76
- Avg merge
- 5h 33m
- Merged PRs (30d)
- 11
Contributor guide
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.
More from SciML/RecursiveArrayTools.jl
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
SciML/RecursiveArrayTools.jl#255 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
SciML/RecursiveArrayTools.jl#662 ·
-
JET: similar_type(::Any) no-matching-method in RecursiveArrayToolsRaggedArrays (pre-existing QA red) Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
SciML/RecursiveArrayTools.jl#620 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
SciML/RecursiveArrayTools.jl#619 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
SciML/RecursiveArrayTools.jl#570 ·
All issues in SciML/RecursiveArrayTools.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
interpolate! from a Float32 LatitudeLongitudeGrid fails on Metal: Float64 division in find_λ_range Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
CliMA/Oceananigans.jl#6056 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
JuliaPluto/PlutoPlotly.jl#72 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
epiforecasts/BVDOutbreakSize#811 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
SciML/NonlinearSolve.jl#1310 · 1 comment ·