summaryrefslogtreecommitdiff
path: root/numpy/random/tests/test_randomstate.py
Commit message (Collapse)AuthorAgeFilesLines
* BUG: accept zeros on numpy.random dirichlet function (#23440)Paulo Almeida2023-04-111-0/+4
| | | | | Changed alpha value error to pass a null value. This way, dirichlet function (on the generator, not mtrand) won't raise a value exception at 0. Also added test.
* TST: Skip tests that are not currently supported in wasmHood Chatham2022-11-111-1/+2
|
* TST,MAINT: Replace most `setup` with `setup_method` (also teardown)Sebastian Berg2022-10-271-5/+5
| | | | | | | | In some cases, the replacement is clearly not what is intended, in those (where setup was called explicitly), I mostly renamed `setup` to `_setup`. The `test_ccompile_opt` is a bit confusing, so left it right now (this will probably fail)
* BUG: Fix boundschecking for `random.logseries`Sebastian Berg2022-10-181-5/+14
| | | | | | | | Logseries previously did not enforce bounds to be strictly exclusive for the upper bound, where it leads to incorrect behavior. The NOT_NAN check is removed, since it was never used: The current bounded version always excludes NaNs.
* ENH: Add the capability to swap the singleton bit generatorKevin Sheppard2022-08-111-0/+67
| | | | | | | Add a new version or seed that supports seeding any bit gen Add set/get_bit_generator as explicity methodds to support swapping closes #21808
* TST: Fix spellingKevin Sheppard2022-07-191-1/+1
|
* BUG/ENH: ALlow bit generators to supply their own ctorKevin Sheppard2022-07-191-0/+18
| | | | | | | Allow bit generators to supply their own constructors to enable Generator objects using arbitrary bit generators to be supported closes #22012
* Port error to RandomStateKevin Sheppard2021-02-261-0/+8
|
* BUG: Prevent RandomState from changingKevin Sheppard2021-02-261-0/+9
| | | | | | | | Apply vonmises fix only to Generator Add tests for correctness closes #17378 closes #17275
* BUG: shuffling empty array with axis=1 was brokenRalf Gommers2021-01-231-1/+5
| | | | | | | | | | | | | This would trigger: ``` NotImplementedError: Axis argument is only supported on ndarray objects ``` because empty arrays and array scalars would take the "untyped" path. The bug exists only for Generator, not in RandomState (it doesn't have axis keyword for `shuffle`), but update both because it keeps implementations in sync and the change results in more understandable code also for RandomState.
* TST: Make test suite work in FIPS (140-2) ModeNikola Forró2020-10-291-32/+32
| | | | | | | | | Tests using MD5 algorithms fail in FIPS Mode because MD5 is not FIPS compliant. Replace MD5 with SHA256 to overcome that. Signed-off-by: Nikola Forró <nforro@redhat.com>
* BUG: Validate output size in bin- and multinomialKevin Sheppard2020-07-141-0/+10
| | | | | | Check that size is not being broadcast closes #16833
* TST: random: Skip a test if integers are 32 bit.Warren Weckesser2020-04-271-0/+2
|
* TST: random: Add more repeatability tests for random integers.Warren Weckesser2020-04-271-0/+22
| | | | | | | Add repeatability tests for when the range of the integers is `2**32` (and `2**32 +/- 1` for good measure) with broadcasting. The underlying functions called by Generator.integers and random.randint when the inputs are broadcast are different than when the inputs are scalars.
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-9/+9
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove uses of scalar aliasesEric Wieser2019-11-131-3/+3
| | | | Relates to gh-6103
* API: make BitGenerators privatemattip2019-10-111-1/+2
|
* BUG: Fix segfault in `random.permutation(x)` when x is a string. (#14241)Maxwell Aladago2019-08-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | * fixing segfault error in np.random.permutation(x) where x is str * removed whitespace * changing error type to ValueError * changing error type to ValueError * changing error type to ValueError * tests * changed error to IndexError for backward compatibility with numpy 1.16 * fixes numpy.randomstate.permutation segfault too * Rolled back to ValueError for Generator.permutation() for all 0-dimensional * fixes refuige erro and rolls backs to AxisError
* ENH: use SeedSequence to generate entropy for seedingmattip2019-06-261-5/+4
|
* MAINT: remove xoshiro* BitGeneratorsmattip2019-06-261-3/+3
|
* BUG: Fix random.choice when probability is not C contiguous (#13716)jeremiedbb2019-06-061-0/+29
| | | * test, fix random.choice sum for non-contiguous
* MAINT: Misc. typo fixes (#13664)luzpaz2019-05-311-1/+1
| | | | | | * DOC, MAINT: Misc. typo fixes Found via `codespell`
* MAINT: fix for dtype specificationmattip2019-05-281-2/+2
|
* ENH: Split poisson_lam_maxKevin Sheppard2019-05-231-1/+1
| | | | | | Use type-dependent poisson lam max Make private Fix backward compat issue in loggam
* BUG: Ensure integer-type stream on 32bitKevin Sheppard2019-05-201-1/+60
| | | | | | Ensure integer type is stream compatible on 32 bit Fix incorrect clause end Add integer-generator tests that check long streams
* MAINT: Implement API changes for randomgen-derived codemattip2019-05-201-5/+5
| | | | | | | | | | | | | | | | | | | | | remove numpy.random.gen, BRNG.generator, pcg*, rand, randn remove use_mask and Lemire's method, fix benchmarks for PCG removal convert brng to bitgen (in C) and bit_generator (in python) convert base R{NG,andom.*} to BitGenerator, fix last commit randint -> integers, remove rand, randn, random_integers RandomGenerator -> Generator, more "basic RNG" -> BitGenerator random_sample -> random, jump -> jumped, resync with randomgen Remove derived code from entropy Port over changes accepted in upstream to protect log(0.0) where relevant fix doctests for jumped, better document choice Remove Python 2.7 shims Use NPY_INLINE to simplify Fix performance.py to work Renam directory brng to bit_generators Fix examples wiht new directory structure Clarify relationship to historical RandomState Remove references to .generator Rename xoshiro256/512starstar
* ENH: Add closed generator to randintKevin Sheppard2019-05-201-1/+0
| | | | Add closed option to randint to simplify some cases
* BUG: Cast high to Python int to avoid overflowKevin Sheppard2019-05-201-0/+8
| | | | Case high to a Python int to avoid overflow from NumPy types
* ENH: Extend multinomial and fix zipfKevin Sheppard2019-05-201-0/+4
| | | | | | Extend multinomial to allow broadcasting Fix zipf changes missed in NumPy Enable 0 as valid input for hypergeometric
* BENCH: convert bencmarks to asv formatmattip2019-05-201-0/+1853
remove files that were part of the origal repo rework randomgen docs to integrate with numpy and fix some links remove convenience functions, require explicit call to gen.brng move code out of numpy.random.randomgen into numpy.random