logaddexp() of integer arrays gives float32, where NumPy gives float64
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
調査の方向性
src/blosc2/ndarray.py の logaddexp() を読み、整数の結果 dtype を issue に記載された NumPy の動作と比較してください。直接呼び出す場合と blosc2.lazyexpr("logaddexp(a, b)", ...) の形式の両方について、記載された整数幅を含めて確認してください。両方の形式が対応する dtype を返し、大きな整数で示された精度を保てば完了です。
索引モデルが issue の本文から書いたものです。
説明
blosc2.logaddexp() sets the result dtype to float32 whenever its operands' result type is an integer (logaddexp() in src/blosc2/ndarray.py: if np.issubdtype(dtype, np.integer): dtype = blosc2.float32). NumPy uses the float type that holds the operands: float64 for 32- and 64-bit integers, float32 for 16-bit ones and float16 for 8-bit ones. The string form, blosc2.lazyexpr("logaddexp(a, b)", ...), gives float32 too. Larger integers lose precision:
import numpy as np
import blosc2
x = np.array([2**24 + 1]) # int64
a = blosc2.asarray(x)
blosc2.logaddexp(a, a).dtype # float32 NumPy: float64
blosc2.logaddexp(a, a)[:] # [16777218.] NumPy: [16777217.69314718]
| operands | blosc2 | NumPy |
|---|---|---|
| int8 | float32 | float16 |
| int16 | float32 | float32 |
| int32, int64, uint32 | float32 | float64 |
The same on main and with #741. Found while checking #754, which does not change logaddexp().
Bool operands raise TypeError: logaddexp doesn't accept boolean arguments., where NumPy gives float16. That may be on purpose, since the docstring asks for floating-point operands, as the array API does.
A fix could take the dtype from NumPy on empty operands, as #754 does for hypot() and the other two-argument float functions. I can send a PR for it if you like.
AI disclosure: the analysis was done with Claude Code; I reviewed it.
- 主要言語
- Python
- スター
- 214
- フォーク
- 72
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 24
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Blosc/python-blosc2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Blosc/python-blosc2#764 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Blosc/python-blosc2#731 ·
メンテナーはふだん 2 日以内に返信
-
documentation sustain-2026
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Blosc/python-blosc2#720 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
sustain-2026
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Blosc/python-blosc2#717 ·
メンテナーはふだん 2 日以内に返信
-
documentation sustain-2026
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Blosc/python-blosc2#714 ·
メンテナーはふだん 2 日以内に返信
Blosc/python-blosc2 の issue をすべて見る
似ている issue
-
[BUG]: Compliance rules never see Unity Catalog views as views対応中かも @wagnercsantos が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
databrickslabs/ontos#1348 ·
メンテナーはふだん 3 日以内に返信
-
`forum_pr_poster` action will always return `none` when checking for pre-existing feedback threads, even if a feedback thread already exists.対応中かも @pgmzeta が今日担当しました。 オープンE-Verified P-Major
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
goonstation/goonstation#28259 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
woonstadrotterdam/monumenten#70 ·
メンテナーはふだん 15 日以内に返信
-
binding:python bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop sessionオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-webui/open-terminal#210 ·