summaryrefslogtreecommitdiff
path: root/numpy/random/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * API: make BitGenerators privatemattip2019-10-112-2/+3
| |
| * API: rename common, bounded_integers -> _common, _bounded_integers; cleanupmattip2019-10-111-1/+1
| |
| * BUG: random: Use correct length when axis is given to shuffle.Warren Weckesser2019-10-081-0/+9
| | | | | | | | | | | | | | When an axis argument was given, shuffle was using the original length of the array instead of the length of the given axis. This meant that, for example, if an array with shape (2, 10) was shuffled with axis=1, only the first two columns were shuffled.
| * BUG: random: Create a legacy implementation of random.binomial.Warren Weckesser2019-09-161-1/+17
| | | | | | | | | | | | | | | | | | Create a legacy implementation of the random_binomial method of RandomState that does not include the "short-circuit" check for n == 0 or p == 0. This ensures that the stream of variates is consistent with the behavior in 1.16. Closes gh-14522.
| * Merge pull request #13829 from kianasun/add-permutation-axisMatti Picus2019-09-161-0/+45
| |\ | | | | | | ENH: Add axis argument to random.permutation and random.shuffle
| | * ENH: Improve permutation and shuffle functions on a given axisKexuan Sun2019-09-141-0/+45
| | |
| * | Merge pull request #14498 from mattip/random-namespaceRalf Gommers2019-09-151-21/+1
| |\ \ | | | | | | | | MAINT: remove the entropy c-extension module
| | * | MAINT: remove the entropy c-extension modulemattip2019-09-131-21/+1
| | |/
| * | BUG: Fix randint when range is 2**32Kevin Sheppard2019-09-141-0/+11
| |/ | | | | | | | | | | Fix randint to use 32-bit path when range is exactly 2**32 closes #14189
| * BUG: Fix segfault in `random.permutation(x)` when x is a string. (#14241)Maxwell Aladago2019-08-222-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | MAINT: remove stray commentsRedRuM2019-10-161-4/+0
| |
* | TST: Parametrize tests using different methodsRedRuM2019-10-161-26/+11
| |
* | Back out use_factor changes, to be restored in a separate PREric Wieser2019-10-161-40/+0
| |
* | MNT: simplify the API by requiring the user to ensure the correct factor is ↵RedRuM2019-08-181-2/+0
| | | | | | | | supplied.
* | ENH: re-write the implementation with new keywords method and use_factorRedRuM2019-08-171-6/+81
| |
* | REV: Undo all changes to codebaseRedRuM2019-08-171-50/+8
| |
* | ENH: Add test cases for proposed API for samlping from a multivariate normal ↵RedRuM2019-08-161-8/+50
|/ | | | distribution
* test shuffle keywordGuillaume Horel2019-07-111-0/+3
|
* fix testsGuillaume Horel2019-07-111-2/+2
|
* fix testsGuillaume Horel2019-07-111-1/+1
|
* fix testsGuillaume Horel2019-07-111-2/+2
|
* ENH: Rename tests for default_rngRobert Kern2019-06-292-2/+2
|
* ENH: Rename default_gen to default_rngRobert Kern2019-06-292-13/+13
|
* BUG: Ensure consistent interpretation of uint64 states. (#13861)Robert Kern2019-06-281-1/+15
| | | * BUG: test, fix for big-endian systems
* ENH: np.random.default_gen() (#13840)Robert Kern2019-06-282-1/+61
| | | * ENH: Rename seed_seq argument to seed and replace Generator() with default_gen()
* ENH: Add SFC64 BitGenerator.Robert Kern2019-06-254-3/+2032
|
* BUG: Fix missing SeedSequence import.Charles Harris2019-06-251-1/+3
|
* MAINT: Fix bad merge.Charles Harris2019-06-251-6/+0
|
* MAINT: remove leftover files, fix docsmattip2019-06-262-2002/+0
|
* ENH: use SeedSequence to generate entropy for seedingmattip2019-06-2612-6679/+6547
|
* MAINT: remove xoshiro* BitGeneratorsmattip2019-06-267-4069/+7
|
* MAINT: remove ThreeFry BitGeneratormattip2019-06-254-2039/+2
|
* MAINT: remove pcg32 BitGeneratormattip2019-06-252-29/+2
|
* MAINT: remove dSFMTmattip2019-06-164-2097/+2
|
* MAINT: random: Rewrite the hypergeometric distribution.Warren Weckesser2019-06-142-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of the changes: * Move the functions random_hypergeometric_hyp, random_hypergeometric_hrua and random_hypergeometric from distributions.c to legacy-distributions.c. These are now the legacy implementation of hypergeometric. * Add the files logfactorial.c and logfactorial.h, containing the function logfactorial(int64_t k). * Add the files random_hypergeometric.c and random_hypergeometric.h, containing the function random_hypergeometric (the new implementation of the hypergeometric distribution). See more details below. * Fix two tests in numpy/random/tests/test_generator_mt19937.py that used values returned by the hypergeometric distribution. The new implementation changes the stream, so those tests needed to be updated. * Remove another test obviated by an added constraint on the arguments of hypergeometric. Details of the rewrite: If you carefully step through the old function rk_hypergeometric_hyp(), you'll see that the end result is basically the same as the new function hypergeometric_sample(), but the new function accomplishes the result with just integers. The floating point calculations in the old code caused problems when the arguments were extremely large (explained in more detail in the unmerged pull request https://github.com/numpy/numpy/pull/9834). The new version of hypergeometric_hrua() is a new translation of Stadlober's ratio-of-uniforms algorithm for the hypergeometric distribution. It fixes a mistake in the old implementation that made the method less efficient than it could be (see the details in the unmerged pull request https://github.com/numpy/numpy/pull/11138), and uses a faster function for computing log(k!). The HRUA algorithm suffers from loss of floating point precision when the arguments are *extremely* large (see the comments in github issue 11443). To avoid these problems, the arguments `ngood` and `nbad` of hypergeometric must be less than 10**9. This constraint obviates an existing regression test that was run on systems with 64 bit long integers, so that test was removed.
* BUG: Make ``Generator._masked`` flag default to ``False``. (#13774)Bernardt Duvenhage2019-06-131-27/+26
| | | | | | | | * Flipped the _masked flag to correctly use Lemire's method as suggested in the comment. See related issue https://github.com/numpy/numpy/issues/13769. * Updated a selection of the unit tests for Lemire's method as opposed to masked rejection sampling. * Removed comments and prints used during testing.
* MAINT: Update PCG jump sizesKevin Sheppard2019-06-061-0/+14
| | | | | Update pcg jump sizes Wrap advance when too large
* BUG: Fix random.choice when probability is not C contiguous (#13716)jeremiedbb2019-06-062-0/+58
| | | * test, fix random.choice sum for non-contiguous
* BUG: Ensure Windows choice returns int32Kevin Sheppard2019-06-021-0/+11
| | | | | | Downcast from searchsorted on Windows to ensure int32 is returned closes #9867
* MAINT: Misc. typo fixes (#13664)luzpaz2019-05-311-1/+1
| | | | | | * DOC, MAINT: Misc. typo fixes Found via `codespell`
* BUG: Fix RandomState argument nameKevin Sheppard2019-05-291-0/+6
| | | | | | RandomState's argument must be named seed for backward compat closes #13669
* BUG/MAINT: Disallow non-native byteorder in random intsKevin Sheppard2019-05-282-0/+13
| | | | | | Warn that non-native byte order is not supported in randint and integers closes #13159
* Merge pull request #13163 from mattip/randomgenSebastian Berg2019-05-2825-12/+21793
|\ | | | | | | | | ENH: randomgen This merges randomgen into numpy, which was originally developed at https://github.com/bashtage/randomgen and provides a new and improved API for random number generation with much new and improved functionality.
| * MAINT: fix for dtype specificationmattip2019-05-282-4/+4
| |
| * STY: Clean up codeKevin Sheppard2019-05-275-67/+89
| | | | | | | | | | | | Pep8 fixes Remove unused imports Fix name error
| * Revert "MAINT: Implement API changes for randomgen-derived code"Kevin Sheppard2019-05-276-2/+4106
| | | | | | | | This reverts commit 17e0070df93f4262908f884dca4b08cb7d0bba7f.
| * MAINT: Remove remnants of bit generatorsKevin Sheppard2019-05-277-6007/+1
| | | | | | | | | | Remove traces of the three removed bit generators Add lock to Cython examples
| * BUG: Change renamed attributeKevin Sheppard2019-05-231-1/+1
| | | | | | | | Change renamed attribute
| * MAINT: Remove test_against_numpyKevin Sheppard2019-05-231-557/+0
| | | | | | | | Remove test file that is circular when randomgen is in numpy
| * ENH: Split poisson_lam_maxKevin Sheppard2019-05-233-3/+4
| | | | | | | | | | | | Use type-dependent poisson lam max Make private Fix backward compat issue in loggam