summaryrefslogtreecommitdiff
path: root/numpy/random
Commit message (Collapse)AuthorAgeFilesLines
* BUG: Fixed an issue where `.pyi` weren't picked up by numpy sub-packagesBas van Beek2020-11-031-0/+1
|
* TST: Make test suite work in FIPS (140-2) ModeNikola Forró2020-10-293-69/+69
| | | | | | | | | 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>
* TST: simplify source path names in compilation testmattip2020-10-271-2/+2
|
* conversion of strings to fstringsJakob2020-10-246-15/+14
|
* DOC: random: Fix default_rng docstring (#17375)Albert Villanova del Moral2020-09-251-1/+1
|
* Merge pull request #17104 from BvB93/sub-modulesCharles Harris2020-09-071-0/+61
|\ | | | | ENH: Add placeholder stubs for all sub-modules
| * ENH: Replace module-level `__getattr__` with explicitly defined objectsBas van Beek2020-08-191-2/+59
| |
| * ENH: Add placeholder stubs for all sub-modulesBas van Beek2020-08-191-0/+4
| |
* | DOC: Fix the link to the quick-start in the old API functionsSebastian Berg2020-09-031-42/+42
| |
* | ENH: random: Add the method `permuted` to Generator. (#15121)Warren Weckesser2020-09-022-62/+294
|/ | | | | | | | | | | * ENH: random: Make _shuffle_raw and _shuffle_int standalone functions. * ENH: random: Add the method `permuted` to Generator. The method permuted(x, axis=None, out=None) shuffles an array. Unlike the existing shuffle method, it shuffles the slices along the given axis independently. Closes gh-5173.
* BUG: fix a compile and a test warningmattip2020-08-091-1/+1
|
* BUG: Validate output size in bin- and multinomialKevin Sheppard2020-07-145-1/+28
| | | | | | Check that size is not being broadcast closes #16833
* DOC: use print() instead of str() for generator object to pass circleci testsLaurie2020-07-121-4/+4
|
* DOC: updates based on mattip's suggestions, add seed to all default_rng so ↵Laurie2020-07-121-14/+12
| | | | tests will pass, get rid of directly printing generator object
* DOC: add examples to random number generator pagesLaurie2020-07-121-0/+55
|
* DOC: Fix RST/numpydoc standard.Matthias Bussonnier2020-07-101-1/+1
| | | | | | | | One of the header line was not long enough, make it the same length as the title. The section "Arguments" is usually called "Parameters". Update for consistency.
* BLD: update cython to 0.29.21mattip2020-07-101-2/+2
|
* BUG: Ensure SeedSequence 0-padding does not collide with spawn keysRobert Kern2020-06-092-2/+37
| | | | | | | | | | | | | Fixes #16539 The implicit 0-padding that is done to small entropy inputs to make them the size of the internal pool conflicts with the spawn keys, which start with an appended 0. In order to maintain stream compatibility with unspawned `SeedSequence`s, we explicitly 0-pad short inputs out to the pool size only if the spawn key is provided, and thus would trigger the bug. This should minimize the impact on users that were not encountering the bug.
* Merge pull request #16504 from bashtage/doc-mv-normCharles Harris2020-06-081-1/+2
|\ | | | | DOC: Correct MV Normal sig
| * DOC: Correct MV Normal sigKevin Sheppard2020-06-051-1/+2
| | | | | | | | Add new kw arg to sig
* | Merge pull request #16510 from madphysicist/patch-1Charles Harris2020-06-081-1/+1
|\ \ | | | | | | DOC: Minor rounding correction in Generator.binomial
| * | DOC: Minor rounding correction in Generator.binomialJoseph Fox-Rabinovitz2020-06-061-1/+1
| |/ | | | | Changed 38.88 from 38 to 39
* | BUG: Fix cython warning in random/_common.pyx.Charles Harris2020-06-071-1/+2
| | | | | | | | | | Fix for #16508. Cython wants every pointer declaration to be on a separate line.
* | BUG: Correct broadcasting when size is not NoneKevin Sheppard2020-06-052-0/+70
|/ | | | | | | Broadcastable size with inputs does not produce an error when size produces a smaller output array than the broadcast input shape. Patch checks that the output shape matches the outer shape of the broadcast fo all inputs and the size when given.
* DEP: Deprecate passing shape=None to mean shape=()Eric Wieser2020-05-312-12/+18
| | | | This requires some minor tweaks in `np.random` because there the two have different meanings, with `()` meaning 0d array and `None` meaning scalar.
* MAINT: precompute log(2.0 * M_PI) in `random_loggam' (gh-16237)Elia Franzella2020-05-191-10/+12
| | | | Most compilers should optimize it, but it doesn't hurt to inline and has a better name now.
* Merge pull request #16156 from WarrenWeckesser/deprecate-dualSebastian Berg2020-05-192-4/+4
|\ | | | | DEP: Deprecate `numpy.dual`.
| * DEP: Deprecate `numpy.dual`.Warren Weckesser2020-05-042-4/+4
| | | | | | | | | | | | Add a deprecation warning in the `numpy.dual` module, and remove the use of `numpy.dual` from the few places where it is used in the numpy code.
* | Merge pull request #16153 from bashtage/fix-mt19937-jumpCharles Harris2020-05-136-329/+210
|\ \ | | | | | | BUG: Correct loop order in MT19937 jump
| * | DOC: Update docstringKevin Sheppard2020-05-121-4/+3
| | | | | | | | | | | | Fix indent on reference and remove text that may be incorrect.
| * | DOC: Improve the docstring for MT19937.jumpedKevin Sheppard2020-05-121-0/+18
| | | | | | | | | | | | Clarify the method used and the source of the code
| * | MAINT: Remove unused fileKevin Sheppard2020-05-121-215/+0
| | | | | | | | | | | | Remove unused file containing the old polynomial representation.
| * | REF: Refactor jump codeKevin Sheppard2020-05-124-121/+154
| | | | | | | | | | | | | | | | | | Refactor polynomial to be unsigned long array Remove unused code Fix md5 calculation on BE
| * | BUG: Correct loop order in MT19937 jumpKevin Sheppard2020-05-123-6/+52
| | | | | | | | | | | | | | | | | | Use the original loop order instead of an inverted order closes #15394
* | | DOC: Fix Generator.choice docstringKevin Sheppard2020-05-132-2/+2
|/ / | | | | | | | | Remove trailing colon Fix indentation in RandomState choice doc string
* | Merge pull request #16162 from mattip/add-pxdCharles Harris2020-05-071-3/+13
|\ \ | | | | | | BUG: add missing numpy/__init__.pxd to the wheel
| * | TST: add tag to __init__.pxd and test that the tag is foundmattip2020-05-061-3/+13
| | |
* | | Mark tests as a subpackage rather than data.Hameer Abbasi2020-05-061-1/+2
| |/ |/|
* | MAINT: Fix random.PCG64 signature in its docstring (#16113)ndunnewind2020-04-291-1/+1
| |
* | BUG: Fix numpy.random.dirichlet returns NaN for small 'alpha' parameters. ↵Benjamin Trendelkamp-Schroer2020-04-292-13/+97
|/ | | | | | | | | | | | | | | (#14924) * Add stick-breaking * Add tests demonstrating slowness for beta and dirichlet generators for small alpha (and beta) values * Remove the test for beta with small `a` and `b` * Switch from standard to stick-breaking method whenever alpha.max() < 0.1 Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* 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-272-0/+45
| | | | | | | 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: random: Add assert() statements.Warren Weckesser2020-04-261-0/+11
| | | | | Assert that an invalid value (2**n-1 for n = 8, 16, 32, 64) has not been passed to the Lemire function.
* BUG: random: Generator.integers(2**32) always returned 0.Warren Weckesser2020-04-262-11/+46
| | | | | | | | | | | | When the input to Generator.integers was 2**32, the value 2**32-1 was being passed as the `rng` argument to the 32-bit Lemire method, but that method requires `rng` be strictly less then 2**32-1. The fix was to handle 2**32-1 by calling next_uint32 directly. This also works for the legacy code without changing the stream of random integers from `randint`. Closes gh-16066.
* DOC: add a note on sampling 2-D arrays to random.choice docstringRalf Gommers2020-04-251-0/+5
| | | | Addresses a comment on gh-10835.
* BUG: missing 'f' prefix for fstringmattip2020-04-221-1/+1
|
* BUG: Alpha parameter must be 1D in `generator.dirichlet` (#15951)panpiort82020-04-184-18/+32
| | | | | Only one dimensional alpha paramter is currently supported, but higher dimensions were silently allowed and gave an incorrect results. This fixes the regression. In the future, the API could be extended to allow higher dimensional arrays for alpha. Fixes gh-15915
* Merge pull request #15876 from panpiort8/multinomial_pvals_1dMatti Picus2020-04-114-4/+16
|\ | | | | BUG: Check that `pvals` is 1D in `_generator.multinomial`.
| * Add minor tests enhancementPan Jan2020-04-062-2/+2
| |
| * Replace checks with direct function callPan Jan2020-04-012-8/+4
| |