Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Size of StaticArray type

未關閉
#3 10 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
32/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
julia
領域
tooling

研究方向

使用 ArrayInterface.known_size、ArrayInterface.size、StaticArray 和 StaticArrays 重現 Julia 範例,然後檢查涉及這些進入點的與 IteratorSize 相關的 dispatch。完成的標準是決定型別層級維度和未知維度的預期行為,以回歸測試加以記錄,並提交任何所需的 StaticArrays 報告。

由索引模型根據 Issue 內容生成。

描述

Using ArrayInterface v5.05 and StaticArrays v1.42:

julia> import ArrayInterface as Arr

julia> using StaticArrays

julia> Arr.known_size(SArray{Tuple{2,3}})
(6,)

julia> Arr.size(StaticArray{Tuple{2,3}})
(static(6),)

Are those the intended results? I expected (2, 3) and (static(2), static(3)), respectively. (Though, things work fine for instances of StaticArrays.)

I think what is happening is that IteratorSize(::Type{<:StaticArray}) is defaulting to HasLength() while it might better off be HasShape{N}(), so the wrong method gets called at some point. If that's the case, perhaps its also worth opening a bug report on StaticArrays.

Also, should ArrayInterface.size produce an error if given a Type as an argument? What should be the behavior if one of the dimensions is unknown?

主要語言
Julia
星號
14
分支
8
PR 合併指標
30 天內沒有已合併 PR

環境準備

我們還沒有檢查這個專案的環境設定檔。先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

JuliaArrays/StaticArrayInterface.jl 的其他 Issue

查看 JuliaArrays/StaticArrayInterface.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。