summaryrefslogtreecommitdiff
path: root/numpy/random
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Remove uses of the WarningManager class.Charles Harris2013-07-121-7/+3
| | | | | | | | | | | | WarningManager was a workaround for the lack of the with statement in Python versions < 2.6. As those versions are no longer supported it can be removed. Deprecation notes are added to WarningManager and WarningMessage, but to avoid a cascade of messages in third party apps, no warnings are raised at this time, that can be done later. Closes #3519.
* BUG: numpy.random.binomial raised ValueError for n == 0HaroldMills2013-06-283-1557/+1608
| | | | | | Range test for n was incorrect. Closes #3480
* ENH: random: Allow ngood=0 or nbad=0 in mtrand.hypergeometric.Warren Weckesser2013-06-133-252/+259
| | | | | Also edited the 'Parameters' section of the docstring to comply with the numpy docstring standard.
* Merge pull request #3243 from seberg/deprecate-non-integer-arguments-newCharles Harris2013-06-091-1/+1
|\ | | | | Deprecate non integer arguments
| * STY: Style fixes for integer deprecation changesSebastian Berg2013-06-091-1/+1
| | | | | | | | Also minor changes in the documentation.
| * MAINT: adept divisions for truedivideSebastian Berg2013-05-311-1/+1
| | | | | | | | Following deprecations would cause problems otherwise.
* | TST: remove docstrings from test_ functionsChristoph Gohlke2013-05-271-13/+8
| | | | | | | | See doc/TESTS.rst.txt for the reason.
* | BUG: Fix multivariate_normal issue with 'size' argumentChristoph Gohlke2013-05-273-4750/+5513
| | | | | | | | Ensure that the multivariate_normal size argument can be a numpy integer. Add regression test. Apply PEP8 to test_regression.py. Regenerate mtrand.c.
* | TST: remove docstring from test_randint_range functionChristoph Gohlke2013-05-271-1/+1
| | | | | | See doc/TESTS.rst.txt for the reason.
* | TST: rename one test_hypergeometric_range functionChristoph Gohlke2013-05-271-1/+1
|/ | | There are two test functions named `test_hypergeometric_range`
* 2to3: Apply the `numliterals` fixer and skip the `long` fixer.Charles Harris2013-04-131-1/+2
| | | | | | | | | | | | | | | | | | | The numliterals fixer replaces the old style octal number like '01' by '0o1' removes the 'L' suffix. Octal values were previously mistakenly specified in some dates, those uses have been corrected by removing the leading zeros. Simply Removing the 'L' suffix should not be a problem, but in some testing code it looks neccesary, so in those places the Python long constructor is used instead. The 'long' type is no longer defined in Python 3. Because we need to have it defined for Python 2 it is added to numpy/compat/np3k.py where it is defined as 'int' for Python 3 and 'long' for Python 2. The `long` fixer then needs to be skipped so that it doesn't undo the good work. Closes #3074, #3067.
* 2to3: Apply `print` fixer.Charles Harris2013-04-066-9/+8
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* Merge pull request #460 from endolith/regex_formattingCharles Harris2013-04-031-1/+0
|\ | | | | DOC: Formatting fixes using regex
| * DOC: Used regex to find colons missing spaces which render wrong online, ↵endolith2013-03-191-1/+0
| | | | | | | | also other spacing or formatting mistakes
* | 2to3: Use absolute imports.Charles Harris2013-03-285-7/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* Merge pull request #2992 from seberg/choice-object-scalarseberg2013-03-043-4241/+4450
|\ | | | | BUG: fix random.choice scalar object result and disallow 0-d arrays
| * MAINT: regenerate mtrand.cSebastian Berg2013-03-041-4223/+4405
| |
| * BUG: fix random.choice scalar object result and disallow 0-d arraysSebastian Berg2013-03-042-18/+45
| | | | | | | | | | | | | | | | | | | | | | Object arrays failed due to bad check for finding out if the result should be a scalar type and not an array when size=None. Also in this case the creation of the new array was wrong. This should be fixed with this. The second fix is to forbid 0-d arrays. Allowing 0-d arrays does not make much sense. But it is dangerous because for example floats will be interpreted as 1-d arrays, while one may expect that they are interpreted as integers. This also saves the trouble of reliably detecting all integers...
* | 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-016-0/+11
|/ | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* DEP: Remove scons related files and code.Charles Harris2013-01-133-92/+0
| | | | | | | | | This removes files and code supporting scons builds. After this change numpy will only support builds using distutils or bento. The removal of scons has been discussed on the list several times and a decision has been made that scons support is no longer needed. This was originally discussed for numpy 1.7 and because the distutils and bento methods are still available we are skipping the usual deprecation period.
* Fixed choice docstring, wrong default sizeJuan Luis Cano Rodríguez2013-01-041-1/+1
| | | Commit acf7421128b9d974d5153759650b7aaee3c2efec introduced a change in the handling of the `size` argument but the docstring wasn't updated accordingly. This commit fixes the issue.
* Merge pull request #2818 from juliantaylor/spellingCharles Harris2012-12-171-1/+1
|\ | | | | fix a spelling error
| * fix a spelling errorJulian Taylor2012-12-141-1/+1
| |
* | BUG: internal call fix in random.choiceSebastian Berg2012-12-153-1260/+1076
|/ | | | | | An random.random call from within mtrand was done by a call to np.random.random instead of inside the class. This can possibly lead to non-deterministic results after seeding.
* MAINT: Regenerate mtrand.cSebastian Berg2012-12-061-3294/+3819
|
* TST: Add tests for new feature and fix in random.choiceSebastian Berg2012-12-061-1/+27
|
* BUG: Fix various problems in the previous commits.Sebastian Berg2012-12-061-9/+17
| | | | Thanks to @alan-isaac for pointing out the 0-d vs. scalar issue.
* BUG: Do not sort new indices in random.choice.Sebastian Berg2012-12-061-2/+3
| | | | | | Random choice used np.unique to find new indices when replace was False and p given. This is wrong since unique will sort the indices. This solves the bug, but likely not ideal.
* ENH: make random.choice size argument default to None and allow tupleSebastian Berg2012-12-061-10/+16
| | | | | The size argument to random.choice should work like it does for all other functions in random as well.
* FIX: loosen numerical tolerance in test_pareto()Nathaniel J. Smith2012-09-071-1/+7
| | | | | | | | | | | | | | | | | The problem was that in 32bit Ubuntu 12.04, one gets the following: > /home/njs/numpy/.tox/py27/local/lib/python2.7/site-packages/numpy/random/tests/test_random.py(363)test_pareto() -> np.testing.assert_array_almost_equal(actual, desired, decimal=15) (Pdb) actual[1, 0] 52828779.702948704 (Pdb) desired[1, 0] 52828779.702948518 and the test was comparing the numbers to 1e-14, which obviously failed. Fixes #424.
* FIX: Regenerate mtrand.c with Cython 0.17Ondřej Čertík2012-09-021-7743/+8196
| | | | Fixes #416
* [FIX] Make np.random.shuffle less brain-deadNathaniel J. Smith2012-07-174-8412/+7867
| | | | | | | | | The logic in np.random.shuffle was... not very sensible. Fixes trac ticket #2074. This patch also exposes a completely unrelated issue in numpy.testing. Filed as Github issue #347 and marked as knownfail for now.
* GEN: regenerate mtrand.c to make doc changes show up.Ralf Gommers2012-07-071-2226/+3025
|
* DOC: merge wiki edits. Add percentile to statistics routines (ML suggestion).Ralf Gommers2012-07-071-13/+13
|
* REF: use simpler API in top bscript.David Cournapeau2012-06-011-1/+1
| | | | We use the new register_outputs_simple + remove some redundant code.
* TST: filter Cython warning on import of random module. Closes #2103.Ralf Gommers2012-04-151-1/+11
|
* STY: Remove trailing whitespace.Charles Harris2012-04-061-1/+1
|
* UPD: Regenerate mtrand.cCharles Harris2012-04-061-3252/+3253
|
* UPD: Add NPY_NO_DEPRECATED_API to some more files.Charles Harris2012-04-061-0/+1
| | | | _dotblas needs more work to remove direct access to ndarray internals.
* UPD: Make numpy.pxd and mtrand.pyx use non-deprecated macros/functions.Charles Harris2012-04-062-123/+132
| | | | | | | The non-deprecated macros and functions were defined for Cython in numpy.pxd and mtrand was fixed to use them. In particular, direct access to structure internals in mtrand.pyx needed to be replaced by the new access functions.
* MOV: Rename numpy.pxi to numpy.pxd to conform to current Cython.Charles Harris2012-04-061-0/+0
|
* GEN: Regenerate mtrand.c from modified mtrand.pyx.Charles Harris2012-03-101-1438/+1560
|
* BUG: Use npy_intp instead of long in mtrand.cgohlke2012-03-104-39/+40
| | | | | This fixes a problem on 64 bit Windows where a 64 bit index is needed but long is only 32 bits.
* DOC: merge wiki doc edits.Ralf Gommers2012-03-032-1229/+1219
|
* BUG: fix some Python 2.4 compatibility issues.Ralf Gommers2012-03-032-1578/+1542
|
* DOC: Fix another detail in randn documentation.Charles Harris2012-02-012-4/+4
|
* DOC: Fix docstrings of rand and randn a bit more and regenerate.Charles Harris2012-01-272-2042/+2044
|
* PYX: Regenerate mtrand.cCharles Harris2012-01-211-4/+4
|
* Fixed RandomState docstrings.Joonas Paalasmaa2012-01-211-3/+3
|
* BUG: Fix dimension checks in random.choice. Make sure last entry in cdfCharles Harris2011-12-172-2473/+2517
| | | | is exactly 1.0.