Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ArrayPartition `A[:]` throws DimensionMismatch

Open
#661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
julia
Domain
devtools

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SciML/RecursiveArrayTools.jl

All issues in SciML/RecursiveArrayTools.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.