Repository navigation
Remove global random seed fixture - #1458
SripriyaDevarapalli wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the set_random_seed autouse fixture from conftest.py, which previously set a fixed random seed using random.seed(0) and np.random.seed(0) during testing. There are no review comments, and I have no additional feedback to provide.
|
@SripriyaDevarapalli Is this still a work in progress? If so, please change this to a draft PR. |
Thanks for checking! This is still a work in progress. I’m reviewing the remaining global random-number usage in the tests to make sure the changes fully address the issue. I’ll mark the PR as a draft while I finish the updates and tests. |
|
Hi! I’ve pushed an initial set of changes replacing global random-number usage with local random generators in the circuit tests. The updated tests pass with multiple I’m continuing to work through the remaining tests that rely on global random state, following the incremental approach suggested in the issue. I’ll run the relevant tests with different seeds as I make further changes, and I’ll remove the global seeds from the root Feedback on the current changes or suggestions on which tests to prioritize would be very welcome. Thank you! |
|
Hi! I’ve marked this PR as ready for review. The current changes convert random number usage to local RNGs in the circuit tests and molecular data test, and all active CI checks are passing. I understand that additional tests may still rely on global random seeds. I’d appreciate your feedback on whether I should convert more tests in this PR before removing the global seeds from Thank you ! |
Addresses #1060.
The test suite previously reset Python and NumPy global random state
before every test. This removes that autouse fixture so tests can rely
on pytest-randomly for per-test random-state handling.
The collection-time seeds in pytest_configure are retained because they
are used for deterministic parameterization during test collection.
Tests:
forkserver failure