finfo should not require float type for the result fields
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- numpy, python
研究方向
從連結的 finfo 規範開始,將其要求的結果型別與 issue 中的 NumPy 範例進行比較。釐清是只有 finfo,還是 finfo 和 iinfo 都應該回傳 0-D arrays,然後更新規範,讓選定的行為和完成條件明確無誤。
由索引模型根據 Issue 內容生成。
描述
Right now finfo requires that the output fields be float https://data-apis.org/array-api/latest/API_specification/generated/signatures.data_type_functions.finfo.html#signatures.data_type_functions.finfo. However, making the results 0-D arrays would be better.
For the spec itself, float is fine, but it's problematic for any library that implements higher precision data types like float128:
>>> import numpy as np
>>> np.finfo(np.float128)
finfo(resolution=1.0000000000000000715e-18, min=-1.189731495357231765e+4932, max=1.189731495357231765e+4932, dtype=float128)
>>> float('-1.189731495357231765e+4932')
-inf
float is essentially a float64, so the various values for float128 cannot be represented as floats. NumPy uses scalars for the values, which for the spec would be 0-D arrays:
>>> type(np.finfo(np.float128).min)
<class 'numpy.float128'>
Even if there are no plans to add float128 to the spec, it's useful for libraries that do have it to have a consistent return type for finfo, since float and a 0-D array aren't 100% duck type compatible.
For iinfo obviously this problem isn't present since int can represent any integer, but it may be good to change it to 0-D array as well just for consistency (although I should note that numpy.iinfo just uses int for its fields).
- 主要語言
- Python
- 星號
- 282
- 分支
- 52
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
data-apis/array-api 的其他 Issue
-
[Bug]: formula for `pinv` is transpose of the pseudoinverse可能已有人在做 @mdhaber 於 29 天前認領。 未關閉bug Maintenance Narrative Content
難度 1/5 1-3 小時 新手友好度 88/100
-
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 5/5 一週以上 新手友好度 35/100
-
Maintenance
-
難度 5/5 一週以上 新手友好度 25/100
查看 data-apis/array-api 的全部 Issue
相似的 Issue
-
Agentic
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
Imbad0202/academic-research-skills#979 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
reflex-dev/reflex#7561 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 62/100
prometheus-community/ansible#906 · 2 則留言 ·