Skip to content

Release 2.5.0

Choose a tag to compare

@bashtage bashtage released this 04 Nov 17:45
· 19 commits to main since this release
77a0e70

The version number follows NumPy's, so there is no 2.4.0.

Warning

Some streams differ from 2.3.0 for the same seed and calls, mostly because output that was wrong has been fixed. See the change log before upgrading code that must reproduce earlier results.

New features

  • MWCX generators: MWC192X, MWC128X, MWC128X32 and MWC64X32, Vigna's scrambled multiply-with-carry generators. Their advance and jumped are fast and can also move backward.
  • Free-threaded Python: importing randomgen does not re-enable the GIL, and one bit generator can be shared between threads. Wheels are built for 3.14t and 3.15t.
  • Per-instance SIMD switches: use_aesni, use_avx2, use_simd and use_sse41 now apply to one instance instead of the whole process.
  • advance_step(max_draws) for PCG64, PCG64DXSM, LCG128Mix and PCG32 returns an odd step for splitting one stream into streams that do not overlap.

Other important changes

  • Stream changes:
    • PCG jumped now uses an odd step based on the golden ratio. PCG64(numpy_seed=True) and PCG64DXSM now match NumPy.
    • Philox and ThreeFry advance now default to counter=False.
    • Fixes to Philox and ThreeFry advance, wishart, SFC64.weyl_increments and random_raw.
  • Stricter validation: an unknown method, or setting a state with another configuration or with values out of range, now raises ValueError.
  • Removed: the in-place jump method, BitGenerator.generator and randomgen.legacy.
  • Requirements: Python 3.10+ and NumPy 1.26+ (but not 2.4.0). Building needs Cython 3.1+.
  • No AVX2 crash: extensions are no longer all compiled with AVX2, so importing randomgen no longer crashes on x86-64 CPUs without it.
  • Development: the development dependencies are now dependency groups (pip install --group dev), and all tool configuration is in pyproject.toml.