Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ArrayPartition `A[:]` throws DimensionMismatch

Aperta
#661 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
julia
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Julia
Stelle
233
Fork
76
Merge medio
5h 33m
PR unite (30g)
11

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SciML/RecursiveArrayTools.jl

Tutte le issue di SciML/RecursiveArrayTools.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.