ArrayPartition `A[:]` throws DimensionMismatch
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Julia
- スター
- 233
- フォーク
- 76
- 平均マージ
- 5時間 33分
- マージ済み PR(30日)
- 11
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SciML/RecursiveArrayTools.jl のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
SciML/RecursiveArrayTools.jl#255 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SciML/RecursiveArrayTools.jl#662 ·
-
JET: similar_type(::Any) no-matching-method in RecursiveArrayToolsRaggedArrays (pre-existing QA red) オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
SciML/RecursiveArrayTools.jl#620 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SciML/RecursiveArrayTools.jl#619 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SciML/RecursiveArrayTools.jl#570 ·
SciML/RecursiveArrayTools.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
CliMA/Oceananigans.jl#6066 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JuliaLang/LinearAlgebra.jl#1707 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JuliaAstro/AstroImages.jl#140 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 90/100