Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

ArrayPartition `A[:]` throws DimensionMismatch

Abierto
#661 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
julia
Área
devtools

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Julia
Estrellas
233
Forks
76
Merge medio
5 h 33 min
PR fusionados (30 d)
11

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de SciML/RecursiveArrayTools.jl

Todos los issues de SciML/RecursiveArrayTools.jl

Issues similares

Más issues de Julia

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.