Skip to content

Make pytest random inputs deterministic#45

Closed
chenzc24 wants to merge 1 commit into
Arcadia-1:mainfrom
chenzc24:codex/fix-36-rng-determinism
Closed

Make pytest random inputs deterministic#45
chenzc24 wants to merge 1 commit into
Arcadia-1:mainfrom
chenzc24:codex/fix-36-rng-determinism

Conversation

@chenzc24

Copy link
Copy Markdown
Contributor

Part of the follow-up work for #36.

Summary:

  • Replace unseeded/global NumPy random calls in unit tests with local np.random.default_rng(...) instances.
  • Keep existing assertions, tolerances, and product code unchanged.
  • Remove one unused seed parameter from a deterministic test helper.

Tests:

  • uv run --with pytest pytest tests/unit/calibration -q
  • uv run --with pytest pytest tests/unit/aout -q
  • uv run --with pytest pytest tests/unit/spectrum -q
  • uv run --with pytest pytest tests/unit/dout/test_plot_residual_scatter.py tests/unit/fundamentals/test_verify_fit_sine_4param.py tests/unit/oversampling/test_matlab_compat_api.py -q
  • uv run --with pytest pytest tests/unit/calibration tests/unit/aout tests/unit/spectrum tests/unit/dout/test_plot_residual_scatter.py tests/unit/fundamentals/test_verify_fit_sine_4param.py tests/unit/oversampling/test_matlab_compat_api.py -q

@Arcadia-1

Copy link
Copy Markdown
Owner

Closing as superseded by #48, which was squash-merged into main and includes this stack layer's deterministic RNG changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants