Skip to content

Use np.random.default_rng() instead of the legacy np.random functions - #90

Open
hhoppe wants to merge 2 commits into
google:mainfrom
hhoppe:modern-rng
Open

hhoppe wants to merge 2 commits into
google:mainfrom
hhoppe:modern-rng

Conversation

@hhoppe

@hhoppe hhoppe commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Replace the legacy global-state calls np.random.rand() and np.random.randint() in the docstring examples with the np.random.Generator API, seeded for reproducibility, as NumPy recommends for new code.

No change in library functionality. All 209 tests pass under Python 3.10 and 3.14.

🤖 Generated with Claude Code

@hhoppe hhoppe mentioned this pull request Sep 25, 2026
@hhoppe

hhoppe commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Unit tests pass on the fork's CI for head commit 8c567a8 (Python 3.10 and 3.x): https://github.com/hhoppe/mediapy/actions/runs/36084579427

This branch has not been deployed

No deployments
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.

1 participant