mirror of
https://github.com/astral-sh/ruff
synced 2026-01-11 00:24:13 -05:00
The new `Generator` in NumPy uses bits provided by [PCG64](https://numpy.org/doc/stable/reference/random/bit_generators/pcg64.html#numpy.random.PCG64) which has better statistical properties than the legacy [MT19937](https://numpy.org/doc/stable/reference/random/bit_generators/mt19937.html#numpy.random.MT19937) used in [RandomState](https://numpy.org/doc/stable/reference/random/legacy.html#numpy.random.RandomState). Global random functions can also be problematic with parallel processing. This rule is probably quite useful for data scientists (perhaps in combination with `nbqa`) References: - [Legacy Random Generation](https://numpy.org/doc/stable/reference/random/legacy.html#legacy) - [Random Sampling](https://numpy.org/doc/stable/reference/random/index.html#random-quick-start) - [Using PyTorch + NumPy? You're making a mistake.](https://tanelp.github.io/posts/a-bug-that-plagues-thousands-of-open-source-ml-projects/)