Remove global random seed used for testing
@SripriyaDevarapalli がすでに取り組んでいます。
2026年10月12日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- numpy, python
調査の方向性
Start by reading the pytest configuration changed in PR #1056 and locate tests that rely on random numbers in their scenarios. Review how those tests seed and use randomness, then identify which need independent generators passed explicitly. Done means the global seed is removed and affected tests retain reliable, independent random state.
索引モデルが issue の本文から書いたものです。
説明
PR #1056 modified the pytest configuration to set a global random number seed, to deal with flaky tests that failed sporadically because some numerical comparisons exceeded tolerances undpredictably. Setting a global seed is not good practice. The seeds for test scenarios should be revised:
-
Avoid global seeds. It's generally better to avoid setting a global seed for all tests. Global seeds can cause unexpected behavior when different parts of the code rely on random numbers.
-
Use
numpy.random.default_rng. It's considered better to create aGeneratorinstance with a seed at the beginning of each test or test suite. This ensures that each test has its own independent random state. -
Pass
Generatorobjects. Pass theGeneratorobject around as an argument. This makes the random number generation explicit and avoids relying on global state.
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 438
- 平均マージ
- 53分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quantumlib/OpenFermion のほかの issue
-
Switch to Pyrefly for type checking instead of mypy対応中かも @rosspeili が 122 日前に担当しました。 オープンa: health a: python e: experienced
quantumlib/OpenFermion#1399 · コメント 6 件 · 担当者 1 名 ·
-
Add a CODEOWNERS file再び着手できるかも @mhucka が 148 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンa: devops e: maintainer
quantumlib/OpenFermion#1337 · コメント 3 件 · 担当者 1 名 ·
-
Add workflow to run create-env-files.sh when Dependabot changes dependencies対応中かも @rosspeili が 130 日前に担当しました。 オープンa: devops e: experienced
quantumlib/OpenFermion#1332 · コメント 4 件 · 担当者 1 名 ·
-
Are there any plans to support symbolic coefficients for QubitOperator?対応中かも @anishbhujbal7 が 83 日前に担当しました。 オープンa: functionality s: awaiting-response
quantumlib/OpenFermion#1053 · コメント 8 件 · 担当者 1 名 ·
-
Hubbard model notebook is flaky再び着手できるかも @Vijay-112007 が 46 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンa: health a: tests e: experienced P2
quantumlib/OpenFermion#870 · コメント 15 件 ·
quantumlib/OpenFermion の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
OpenFreeEnergy/openfe#2371 ·
メンテナーはふだん 2 日以内に返信
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
NCATSTranslator/Babel#1269 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
404 on sample dataオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100