summaryrefslogtreecommitdiff
path: root/numpy/random/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * MAINT: remove tomaxint, random_sample from generatormattip2019-05-233-28/+0
| |
| * BUG: test, fix missing return to deprecated functionmattip2019-05-231-1/+8
| |
| * MAINT: remove threefry32, xoroshiro128, xorshift1024 BitGeneratorsmattip2019-05-202-96/+6
| |
| * BUG: Ensure integer-type stream on 32bitKevin Sheppard2019-05-202-6/+65
| | | | | | | | | | | | 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-2015-4839/+619
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-202-74/+117
| | | | | | | | 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: Add fast path for randint broadcastingKevin Sheppard2019-05-202-1/+31
| | | | | | | | | | | | Add path that voids object conversion unless essential Small doc cleanups related to random_integers PEP-8 cleanups
| * ENH: Finish hypergeometric 0Kevin Sheppard2019-05-201-2/+2
| | | | | | | | | | | | Add changes to alow hypergeometric 0 Small syncs and cleanups Move legacy_distributions.pxd to legacy folder can be deleted
| * ENH: Improvce choice without replacementKevin Sheppard2019-05-202-5/+28
| | | | | | | | | | | | | | | | | | | | Improve performance in all cases Large improvement with size is small xref numpy/numpy#5299 xref numpy/numpy#2764 xref numpy/numpy#9855 xref numpy/numpy#7810
| * MAINT: Simplify return typesKevin Sheppard2019-05-202-0/+13
| | | | | | | | | | | | Standardize returns types for Windows and 32-bit platforms on int64 in choice and randint (default). Refactor tomaxint to call randint
| * ENH: Extend multinomial and fix zipfKevin Sheppard2019-05-202-8/+30
| | | | | | | | | | | | 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-2030-0/+28350
| | | | | | | | | | | | | | 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
* | Deprecate collapsing shape-1 dtype fields to scalars.Antony Lee2019-05-241-2/+1
| | | | | | | | | | | | | | | | | | Currently, a field specified as `[(name, dtype, 1)]` is interpreted as a scalar field (i.e., the same as `[(name, dtype)]` or `[(name, dtype, ()]`). This now raises a FutureWarning; in a future version, it will be interpreted as a shape-(1,) field, i.e. the same as `[(name, dtype, (1,))]` (consistently with `[(name, dtype, n)]` with `n>1`, which is already equivalent to `[(name, dtype, (n,)]`).
* | MAINT: Fix errors seen on new python 3.8Sebastian Berg2019-05-211-2/+4
|/ | | | | | | | | | | | | | One of this is a small issue exposed by new warnings, the others are simply adapting our test suit to stricter integer coercion rules (avoiding float -> int conversions). The last one is that we assumed pickle protocol 5 would be in 3.8. It is not yet included in the alpha releases at least. It seems not necessary for the numpy test suit to check whether it is available based on the python version so removing that test. (Also testing if the pickle5 module works seems unnecessary.) Closes gh-13412
* Merge pull request #12547 from bashtage/mvnormal-tol-checkAllan Haldane2019-03-211-0/+6
|\ | | | | ENH: Cast covariance to double in random mvnormal
| * ENH: Cast covariance to double in random mvnormalKevin Sheppard2018-12-141-0/+6
| | | | | | | | | | | | | | Cast the covariance in the multivariate normal to double so that the interpretation of tol is cleaner. closes #10839
* | Added issue number in commentBharat123Rox2019-03-051-0/+1
| |
* | Added more tests as suggested by @eric-wieserBharat123Rox2019-03-051-0/+2
| |
* | Fix #13087 by raising a ValueError and adding a unit test for itBharat123Rox2019-03-051-0/+1
| |
* | DOC: Fix Wald docstringKevin Sheppard2019-02-181-0/+2
| | | | | | | | | | Fix Wald Docstring to reflect actual restriction on parameters Add a test to ensure these are enforced for scalar inputs
* | BUG: Ensure probabilities are not NaN in choiceKevin Sheppard2018-12-141-0/+5
|/ | | | | | Add a check for NaN probabilities in random.choice closes #11250
* BUG: random: Fix handling of a=0 for numpy.random.weibull.Warren Weckesser2018-11-121-1/+2
| | | | | | | Before this fix, np.random.weibull(a=0) often returned inf (and in theory could have returned 1). It should only return 0. Closes gh-12371.
* Merge pull request #11771 from asnasnasn/shuf-mmMatti Picus2018-10-121-0/+4
|\ | | | | BUG: Make `random.shuffle` work on 1-D instances of `ndarray` subclasses
| * BUG: Make `random.shuffle` work on 1-D instances of `ndarray` subclassesWenjamin Petrenko2018-08-181-0/+4
| | | | | | | | Closes #11442.
* | BUG: Fix in-place permutationKevin Sheppard2018-10-101-0/+22
| | | | | | | | | | | | | | Alter test to check if arrays are the same to avoid in-place of some array-like objects closes #11975
* | MAINT: remove redundant importsmattip2018-09-091-1/+0
| |
* | MAINT: reformat line spacing before test methodsmattip2018-08-191-1/+0
|/
* fixes from reviewmattip2018-06-211-4/+5
|
* ENH: Allow size=0 in numpy.random.choicemattip2018-06-191-0/+8
|
* HTTP -> HTTPS, and other linkrot fixesMike Toews2018-06-161-1/+1
|
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-062-8/+2
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* More misc. typosluz.paz2018-01-041-1/+1
| | | Found via `codespell`
* BUG: Prevent invalid array shapes in seedKevin Sheppard2017-10-181-0/+7
| | | | | | | Prevent empty arrays or arrays with more than 1 dimension from being used to seed RandomState closes #9832
* BUG: Check for NaN parameter in random.zipf.Charles Harris2017-10-061-2/+6
| | | | Avoids infinite loop.
* ENH: Remove unnecessary restriction in noncen-fKevin Sheppard2017-08-221-1/+7
| | | | | | Set dfnum restriction to be > 0 as required by noncentral chisquare closes #6638
* BUG: Missing dirichlet input validationKevin Sheppard2017-08-171-0/+5
| | | | | | | | Dirichlet does not validate inputs and hangs when values are zero. Adds check that values are strictly positive as required by the distribution. closes #2089
* TST, MAINT: Add `__init__.py` files to tests directories.Charles Harris2017-08-061-0/+0
| | | | | | | | This allows pytest to run with duplicate test file names. Note that `python <path-to-test-file>` no longer works with this change, nor will a simple `pytest numpy`, because numpy is imported from the numpy repository. However, `python runtests.py` and `>>> numpy.test()` are still available.
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-10/+10
| | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* TST: Remove unittest dependencies in numpy/random/tests.Charles Harris2017-07-242-30/+32
|
* BUG: Buttress handling of extreme values in randintgfyoung2017-05-092-10/+44
|
* BUG: Check for errors when PyInt_AsLong is called in np.randomSimon Gibbons2017-04-021-8/+15
| | | | | | | | | After #8883 was merged it was noticed that the same problem was occuring with calls to PyInt_AsLong. Namely that PyErr_Occoured wasn't being checked if it returned -1 indicating an exception could have been thrown. This PR adds those checks as well as a regression test.
* Fix testSimon Gibbons2017-04-011-1/+1
|
* BUG: Ensure Errors are correctly checked when PyFloat_AsDouble is called.Simon Gibbons2017-04-011-0/+14
| | | | | | | | | | | | | | There was an error in np.random.uniform where if np.random.uniform were called with a type that throwed exceptions when it was converted to a float this exception wouldn't be raised. This bug was due to an issue where PyFloat_AsDouble was called but no check for PyErr_Occurred was performed after. This PR fixes the issue by ensuring that Cython will always emit a call to PyErr_Occurred if PyFloat_AsDouble returns -1.0 Fixes: #8865
* DOC: update docs and comments for move of mailing list to python.orgRalf Gommers2017-03-261-1/+1
|
* MAINT: Remove asbytes where a b prefix would sufficeEric Wieser2017-03-251-2/+1
| | | | | | | | Since we only need to support python 2, we can remove any case where we just pass a single string literal and use the b prefix instead. What we can't do is transform asbytes("tests %d" % num), because %-formatting fails on bytes in python 3.x < 3.5.
* Revert gh-8570.Charles Harris2017-03-131-40/+0
| | | | | | | | BUG: fix issue #8250 where np.random.permutation fail. This reverts commit 7a73bad2d9c04e4f16e87dbed9d7b627327fe814. Closes #8776.
* Merge pull request #8570 from evanlimanto/random-permutation-shuffle-fixEric Wieser2017-03-121-0/+40
|\ | | | | BUG: fix issue #8250 when np.array gets called on an invalid sequence
| * BUG: fix issue #8250 where np.random.permutation fails when np.array gets ↵Evan Limanto2017-03-101-0/+40
| | | | | | | | called on an invalid sequence.
* | BUG: Fix assert statements in random.choice testsMarein Könings2017-02-281-5/+5
|/ | | | Unless I am very much mistaken these 'assert_(x,y)' calls should really be 'assert_equal(x,y)'.