Remove global random seed used for testing
@SripriyaDevarapalli đang làm issue này rồi.
Từ ngày 12/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- numpy, python
- Lĩnh vực
- machine-learning, testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1.7k
- Fork
- 438
- Merge trung bình
- 53 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quantumlib/OpenFermion
-
Switch to Pyrefly for type checking instead of mypyCó thể đã có người làm @rosspeili đã nhận 122 ngày trước. Đang mởa: health a: python e: experienced
quantumlib/OpenFermion#1399 · 6 bình luận · 1 người được giao ·
-
Add a CODEOWNERS fileCó thể làm lại được @mhucka đã nhận 148 ngày trước và không có pull request nào đang mở. Đang mởa: devops e: maintainer
quantumlib/OpenFermion#1337 · 3 bình luận · 1 người được giao ·
-
Add workflow to run create-env-files.sh when Dependabot changes dependenciesCó thể đã có người làm @rosspeili đã nhận 130 ngày trước. Đang mởa: devops e: experienced
quantumlib/OpenFermion#1332 · 4 bình luận · 1 người được giao ·
-
Are there any plans to support symbolic coefficients for QubitOperator?Có thể đã có người làm @anishbhujbal7 đã nhận 83 ngày trước. Đang mởa: functionality s: awaiting-response
quantumlib/OpenFermion#1053 · 8 bình luận · 1 người được giao ·
-
Hubbard model notebook is flakyCó thể làm lại được @Vijay-112007 đã nhận 46 ngày trước và không có pull request nào đang mở. Đang mởa: health a: tests e: experienced P2
quantumlib/OpenFermion#870 · 15 bình luận ·
Tất cả issue của quantumlib/OpenFermion
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
OpenFreeEnergy/openfe#2371 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
NCATSTranslator/Babel#1269 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
404 on sample dataĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100