Bashtage Randomgen Versions Save

Numpy-compatible bit generators and add some random variate distributions missing from NumPy.

v1.19.2

3 years ago

This is a bug-fix release with one fixed issue:

  • Corrected RDRAND to retry on failures with pause between retries. Add a parameter retry which allows the number of retries to be set. It defaults to the Intel recommended value of 10. Also sets an exception when the number of retries has been exhausted (very unlikely). See the RDRAND docstring with unique considerations when using RDRAND that do not occur with deterministic PRNGs.

v1.19.1

3 years ago

This is a minor release with two new features:

  • Added Romu which is among the fastest available bit generators.
  • Added SFC64.weyl_increments to simplify generating increments for use in parallel applications of SFC64.
  • Completed QA of all bit generators to at least 4TB.

v1.19.0

3 years ago

This is a feature and bug-fix release. The key new features are:

  • Deprecated Generator and RandomState since these are both available in NumPy.
  • Added ExtendedGenerator which contains features not in numpy.random.Generator.
  • Added UserBitGenerator which allows bit generators to be written in Python or numba.
  • New bit generators:
    • Added PCG64DXSM which is is the 2.0 version of PCG64 and will likely become the default bit generator in NumPy in the near future.
    • Added EFIIX64 (a.k.a. efiix64x48) which is both fast and high-quality.
    • Added SFC64 which supports generating streams using distinct Weyl constants.
    • Added LCG128Mix which supports setting the LCG multiplier, changing the output function (including support for user-defined output functions) and pre- or post-state update generation.
    • Added LXM which generates variates using a mix of two simple, but flawed generators: a Xorshift and a 64-bit LCG. This has been proposed for including in Java.
  • Tested all bit generators using at least 1TB in PractRand in different configurations. This is WIP and all generators will be tested to at least 4TB.
  • Additional features and fixes:
    • Added support for the dxsm and dxsm-128 variants of PCG64. The dxsm variant is the official PCG 2.0 generator.
    • Added support for broadcasting inputs in ExtendedGenerator.multivariate_normal.
    • Added support for the ++ variant of Xoroshiro128.
    • Fixed a bug the produced incorrect results in randomgen.mt19937.MT19937.jumped.
    • Fixed multiple bugs in Generator that were fixed in numpy.random.Generator.

v1.18.1

4 years ago

This release brings many breaking changes. Most of these have been implemented using DeprecationWarnings. This has been done to bring randomgen in-line with the API changes of the version going into NumPy.

Change in 1.18.1:

  • Fix a build bug affecting Windows wheel generation (

Changes in 1.18:

  • Dropped support for Python 2.7
  • Synchronized with the randomgen merges into NumPy 1.17 and their fixes coming in 1.18
  • Added support for SeedSequence (and NumPy’s SeedSequence).
  • The .generator method of the bit generators raise NotImplementedError
  • The internal structures that is used in C have been renamed. The main rename is brng_t to bitgen_t
  • Rename RandomGenerator to Generator.
  • Rename randint() to integers().
  • Rename random_integers() to integers().
  • Rename random_sample() to random().
  • Change jump which operated in-place to jumped() which returns a new BitGenerator.
  • Rename Basic RNG to bit generator, which has been consistently applied across the docs and references
  • Add the integer-based SIMD-based Fast Mersenne Twister (SFMT) generator SFMT.
  • Add the 64-bit Mersenne Twister (MT64) generator MT64.
  • Renamed Xoshiro256StarStar to Xoshiro256 and Xoshiro512StarStar to Xoshiro512

v1.18.0

4 years ago

This release brings many breaking changes. Most of these have been implemented using DeprecationWarnings. This has been done to bring randomgen in-line with the API changes of the version going into NumPy.

  • Dropped support for Python 2.7
  • Synchronized with the randomgen merges into NumPy 1.17 and their fixes coming in 1.18
  • Added support for SeedSequence (and NumPy’s SeedSequence).
  • The .generator method of the bit generators raise NotImplementedError
  • The internal structures that is used in C have been renamed. The main rename is brng_t to bitgen_t
  • Rename RandomGenerator to Generator.
  • Rename randint() to integers().
  • Rename random_integers() to integers().
  • Rename random_sample() to random().
  • Change jump which operated in-place to jumped() which returns a new BitGenerator.
  • Rename Basic RNG to bit generator, which has been consistently applied across the docs and references
  • Add the integer-based SIMD-based Fast Mersenne Twister (SFMT) generator SFMT.
  • Add the 64-bit Mersenne Twister (MT64) generator MT64.
  • Renamed Xoshiro256StarStar to Xoshiro256 and Xoshiro512StarStar to Xoshiro512

v1.16.6

5 years ago

This is a bug fix and performance fix:

  • Changed the default jump step size to phi times the period of the generator for PCG32 and PCG64.
  • Improved the performance of PCG64 on Windows.
  • Improved performance of DSFMT.jump and DSFMT.jumped.
  • Improves backward compatibility of RandomState

v1.16.5

5 years ago
  • Fixed bugs in multiple distributions that could result in nan values in rare circumstances (about 1 in 10E53)
  • Added keyword closed to randint which changes sampling from the half-open interval [low, high) to the closed interval [low, high].
  • Fixed a bug in random_integers that could lead to valid values being treated as invalid.

v1.16.4

5 years ago

This is a feature release that is closely synchronized with the copy in NEP-19:

New features include:

  • Add a fast path for broadcasting RandomGenerator.randint when using uint64 or int64.
  • Refactor PCG64 so that it does not rely on Cython conditional compilation.
  • Add RandomGenerator.brng to access the basic RNG.
  • Allow multidimensional arrays in RandomGenerator.choice.
  • Speed-up RandomGenerator.choice when not replacing. The gains can be very large (1000x or more) when the input array is large but the sample size is small.
  • Add parameter checks in RandomGenerator.multinomial.
  • Fix an edge-case bug in RandomGenerator.zipf.
  • Allow 0 for sample in RandomGenerator.hypergeometric.
  • Add broadcasting to RandomGenerator.multinomial.

v1.16.3

5 years ago

This is a release that restores Python 2.7 compatibility.

v1.16.2

5 years ago
  • Updated Xoroshiro120 to use AUthor's latest parameterization

  • Closely synchronized with the version of randomgen being integrated into NumPy, including removing:

    • random_raw, which have been moved to the individual basic RNGs
    • random_uintegers, which can be replaced with randint.
  • Added RandomState as a clone of NumPy's RandomState.

  • Removed LegacyGenerator since this is nolonger needed

  • Fixed many small bugs, including in cffi and ctype interfaces