Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Avoid inplace operators in general tests

オープン
#287 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
numpy, python
領域
testing

調査の方向性

array_api_tests/pytest_helpers.py の483行目付近から始め、inplace 演算子を使用する汎用テストを調べます。issue に示されているスカラーの動作を再現し、その後、影響を受ける一般テストを実行します。NumPy のスカラー実装がそこで失敗しなくなり、関連する array API テストも引き続きパスすれば完了です。

索引モデルが issue の本文から書いたものです。

説明

low priority

numpy returns scalars instead of 0d arrays:

import numpy as np
import array_api_strict as xps

xps.mean(xps.asarray(4, dtype=xps.float32)).__iadd__(1)
np.mean(np.asarray(4, dtype=np.float32)).__iadd__(1)  # AttributeError: 'numpy.float32' object has no attribute '__iadd__'

And this causes errors in unrelated tests since inplace operators are used in more generic tests:
https://github.com/data-apis/array-api-tests/blob/4caff2867c69d5b9b329320319b61c5444bf6f87/array_api_tests/pytest_helpers.py#L483

I don't think using inplace-operators in this case is particularly important and can probably be switched to a normal bitwise or.

xref: https://github.com/numpy/numpy/issues/27305

主要言語
Python
スター
74
フォーク
54
平均マージ
4時間 35分
マージ済み PR(30日)
4

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

data-apis/array-api-tests のほかの issue

data-apis/array-api-tests の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。